sanitize innout numbers only php code example
Example 1: php keep only numbers in string
$str = preg_replace('/[^0-9.]+/', '', $str);
Example 2: php keep only digitts
preg_replace('/\D/', '', $c)
$str = preg_replace('/[^0-9.]+/', '', $str);
preg_replace('/\D/', '', $c)