RE: preg_match - help please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: André Medeiros [mailto:andre.caum@xxxxxxxxx] 

> On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote:
> > From: André Medeiros [mailto:andre.caum@xxxxxxxxx] 
> > 
> > > On Wed, 2005-07-27 at 16:16 +0100, Mark Rees wrote:
> > > 
> > > > Or even four - like Rafael van der Vaart for example - so 
> > > make sure that the
> > > > surname box matches spaces as well, and special characters 
> > > like the ê, as
> > > > well as ' as in John O'Kane
> > > > 
> > > 
> > > Yeah, that's why strpos will make his life much easier :)
> > 
> > Can you explain how you'd use strpos() in this situation? I 
> was going to ask earlier, but didn't bother, but now I'm curious...
> > 
> 
> That's not very nice of you, saying that to people who try to help ;)

Well, it could be argued that an obtuse link to the online docs and nothing else isn't "trying to help."   ;)

> if( strpos( $_POST['frmName'], ' ' ) === false ) {
>     // Do error handling here
> } else {
>     // All is OK :)
> }

Gotcha. Except that it'll accept a ' ' string as valid.   :P

-- 
Mike Johnson             Smarter Living, Inc.
Web Developer            www.smartertravel.com
mike@xxxxxxxxxxxxxxxxx   (617) 886-5539

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux