the easiest way would be:
";
//
// output:
// abcdefghi
//
//
// or a regex:
$str = "abc def ghi";
$str = ereg_replace(" ", "", $str);
echo $str."";
//if you want to strip any whitespace character:
$str = "abc def ghi";
$str = preg_replac
-Original Message-
From: Chuck Barnett [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 03, 2002 2:01 PM
To: PHP General List
Subject: [PHP] strip spaces from inside string
Say I have a string "xyz abc def" and I want to remove all of the spaces
withing the string to create a new one
> Say I have a string "xyz abc def" and I want to remove all of the spaces
> withing the string to create a new one. What's the best way?
Or you can use eregi_replace(), but I don't know what the regex would be.
I *think* you can do:
Chris
--
PHP General Mailing List (http://www.php.ne
3 matches
Mail list logo