The title and the code is pretty much self explanatory...
but just to clarify more...
I want to stay with a single space between each word inside $myString
(and remove bad words)...
I prefer to stay in single line if possible...
$myString = 'There will be no extra space here !!!';
str_replace(array("bad words","another bad words","\s+"), '', $myString);
I'm expecting to get :
There will be no extra space here !!!
Thanks!