Is there an easy string function that will remove all white spaces from a string. EX.
$mystring = "hello goodbye blue red yellow green";
i want the string to be:
hellogoodbyeblueredyellowgreen
Thanks.
Well, let's start with the obvious --
$mystring = str_replace(" ", "", $mystring);
Are we missing something? Do you want something different?
Man do I feel dumb. For I don't know how long, I've been using this:
$result = ""; for ($i = 0; $i < strlen($str); $i++) if ($str[$i] != " ") $result .= $str[$i];
That's a big Homer "d'oh" for me. Thanks.