ugh... i really feel stupid when it comes to these:
$str = ereg_replace("[,]{1}[\s]* ",",",$str);
replace any instace of a single comma followed by ANY number of spaces with just a comma
$str = preg_replace('/\,\s+/', ',', $str);
EDIT: I changed the space to \s, in view that you appear to mean whitespace instead of space.
just so I get this all my regex's should have this format:
preg_replace('/<STUFF TO LOOK FOR>/', '<REPLACEMENT>', <STRING>);
I also didnt know commas had to be escaped... and why did u use + and not ... i thought meant 1 or more
I also didnt know commas had to be escaped
They dont have to be, if I remember correctly, but in case I didnt, I escaped them anyway.
why did u use + and not ... i thought meant 1 or more
In this context, + means one or more, * means zero or more.
awesome... you rock my world LL 🙂