I have a whole bunch of names in the following
$who="michael,katrina,tim,lance";
and the like.
What im doing is putting them in alphabetical order, i use sort() and its all good.
Here is the problem. sometimes there is a space between names
like
katrina, michael
of course sort returns the space character as the first, even when the name following should not have that!
So either, how do I strip the first character of an array element if it is a space? Is it something like
if($who[0][0]==" "){somehow delete the first character or str_replace the space)
Ive been trying to str_replace(", ", ",",$who)
but it keeps returning a parse error (why did i use commas in the first place ARRRRRGGGH).
Any help would be greatly appreciated.
mike