strip whitespace?
Posted: Fri Feb 18, 2005 2:58 pm
Ok, I know about trim(), ltrim() and rtrim(). But is there a way to just strip ALL whitespace from a string?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$str = str_replace(" ","",$str);Code: Select all
$str = preg_replace('#\s+#s', '', $str);