Re: Validating input

From: Date: Fri, 28 Jan 2005 20:22:13 +0000
Subject: Re: Validating input
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-207634@lists.php.net to get a copy of this message
John Nichel wrote:
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
There's also ctype_digit... http://us4.php.net/ctype_digit And if you really want to use a regex to check for just digits... /^\d{1,}$/ -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#207634) next »