View Single Post

  #4 (permalink)  
Old 06-30-2003
James Sleeman
 
Posts: n/a
Default Re: Quick String Query...

Jamie Wright wrote:

>> $string = preg_replace('/\s+/', '', $string);

>
> Cheers for that. You wouldn't care to explain the /\s+/ would you? Does
> this mean 'space'?


Yes, that is a regular expression, \s means whitespace and + means one or
more, so the expression matches one or more whitespace characters.

Regular Expression Syntax :
http://nz.php.net/manual/en/pcre.pattern.syntax.php

--
James Sleeman
Gogo:Code http://www.gogo.co.nz/
Email domain : gogo.co.nz see user in from header!
Reply With Quote