Re: preg_match - help please

From: Date: Wed, 27 Jul 2005 15:55:00 +0000
Subject: Re: preg_match - help please
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-219429@lists.php.net to get a copy of this message
André Medeiros wrote:
That's not very nice of you, saying that to people who try to help ;) if( strpos( $_POST['frmName'], ' ' ) === false ) {
    // Do error handling here
} else {
    // All is OK :)
}
How does that match "Firstname Lastname" better than a regex? That will return true as long as there is at least one space, no matter what the rest of the submission is. I could submit "$^&#^&$&#& )(*!@#", or I could submit just a single space, and that would return true. strpos() has it's uses, but this isn't one of them. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#219429) next »