I meant how to add that ability to the pre_replace line I posted, so it does that also. I know how to do it by itself.
Also, your second one doesn't work for spaces. This does:
PHP Code:
$str = str_replace(" ","",$str);
Now, it there any way to get the preg_replace to do that also between the commas? Right now it only works on spaces before and after the commas themselves.