$string = 'Hello this is a bunch of numbers: 333 and letters and $pecial Characters@!*(';
$foo = preg_replace("/[^a-zA-Z0-9\s]/", "", $string);
echo $foo;
The above returns:
Hello this is a bunch of numbers 333 and letters and pecial Characters
I want to retain spaces but not if theres more than one. How can that be done?
It should look like:
Hello this is a bunch of numbers 333 and letters and pecial Characters