Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get only numbers from string

$str = 'In My Cart : 11 items';
$int = (int) filter_var($str, FILTER_SANITIZE_NUMBER_INT);
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #php #numbers #string
ADD COMMENT
Topic
Name
6+2 =