RE: [PHP] preg_match - help please
| From: | Mike Johnson | Date: | Wed, 27 Jul 2005 15:56:52 +0000 |
| Subject: | RE: [PHP] preg_match - help please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-219431@lists.php.net to get a copy of this message | ||
From: André Medeiros [mailto:andre.caum@gmail.com]
> On Wed, 2005-07-27 at 11:41 -0400, Mike Johnson wrote:
> > From: André Medeiros [mailto:andre.caum@gmail.com]
> >
> > > 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@smarterliving.com (617) 886-5539