Answers for "php filter string only digits"

PHP
1

php keep only numbers in string

$str = preg_replace('/[^0-9.]+/', '', $str);
Posted by: Guest on February-25-2020
2

php filter only numbers

$output = preg_replace( '/[^0-9]/', '', $string );
Posted by: Guest on June-19-2020

Code answers related to "php filter string only digits"

Browse Popular Code Answers by Language