Answers for "getting only numbers from a string in php"

PHP
2

php get only numbers from string

$str = 'In My Cart : 11 items';
$int = (int) filter_var($str, FILTER_SANITIZE_NUMBER_INT);
Posted by: Guest on November-24-2020

Code answers related to "getting only numbers from a string in php"

Browse Popular Code Answers by Language