get all numbers and characters in string without string php code example
Example: php remove characters not numbers or letters
$res = preg_replace("/[^a-zA-Z0-9\s]/", "", $string);
$res = preg_replace("/[^a-zA-Z0-9\s]/", "", $string);