$str = “@ % * alpha numeric 0 – 9 only _ – +@_#()()++”;
$str = preg_replace(‘/[^A-Za-z0-9]/’, ”, $str);
echo $str;
returns alphanumeric09only
misc code snippets
$str = “@ % * alpha numeric 0 – 9 only _ – +@_#()()++”;
$str = preg_replace(‘/[^A-Za-z0-9]/’, ”, $str);
echo $str;
returns alphanumeric09only
PHP alpha numeric only strings
Oct, 17 -- Categories: PHP