Re: if $char == "any form of white space"
| From: | Richard Lynch | Date: | Sun, 21 Jul 2002 05:30:00 +0000 |
| Subject: | Re: if $char == "any form of white space" | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108705@lists.php.net to get a copy of this message | ||
>Is this the best way to check if a $char is ANY FORM OF WHITESPACE (space,
>\t, \r, \n, etc etc)?
>
>
>if(preg_match('/\s/', $char))
Probably. But you're asking for a Holy Jihad between the POSIX Regex guys
and the Perl Geeks to even ask the question :-)
Oh, and technically, you need '/\\s/' since \ needs to be escaped even
inside of '' for PHP.
--
Like Music? http://l-i-e.com/artists.htm