I plan on doing mucho clean up on submitted info (from a single row)... Let's say I want to add spaces after commas, change .... to ... , add a space after all periods, add astrixes to swearwords, convert all extra spaces to a single space.etc etc.
From what I know (little I might add) I could do something like...
$mystring = str_replace("....", "...", $mystring);
$mystring2 = str_replace(",", ", ", $mystring);
$mystring3 = str_replace(".", ". ", $mystring2);
$mystring4 = str_replace(" ", " ", $mystring3);
$mystring5 = str_replace(" ", " ", $mystring4);
$mystring6 = str_replace("badword", "bdword", $mystring5);
$mystring7 = str_replace("damn", "dmn", $mystring6);
The net result being mystring7
My question is there a better way to do this... perhaps inside a single string replace?