hi,

i didn't find a function for this in the manual, but maybe there is one (or
a workaround):

does anyone have a solution for replacing multiple whitespaces with a single
whitespace whitin a string? similar to trim(). maybe a regular expression?

eg:
$string = 'word1   word2     word3';

$modified = preg_replace('|(\\s)+|','$1',$string);

$modified = 'word1 word2 word3';




--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to