Re: Validating input

From: Date: Fri, 28 Jan 2005 20:16:45 +0000
Subject: Re: Validating input
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207632@lists.php.net to get a copy of this message
Ed Curtis wrote:
I've been looking at the docs and found preg_match and preg_match_all but these functions only seem to match 1 specific search item. I want to make sure a variable (say $mlsnumber) contains only numbers and no spaces. What would I use to accomplish this? Thanks Ed
You really don't need a regex for this.... Can it be a float? is_numeric() http://us4.php.net/is_numeric Only a float? is_float() http://us4.php.net/is_float Only an integer? is_int() http://us4.php.net/is_int -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#207632) next »