Re: Validating form field text input to be aspecificvariable type

From: Date: Wed, 07 Apr 2004 14:54:58 +0000
Subject: Re: Validating form field text input to be aspecificvariable type
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-182645@lists.php.net to get a copy of this message
From: "William Lovaton" <williama_lovaton@coomeva.com.co> > I guess that works but every possible solution posted in this thread is > a lot of lines of code to perform a simple validation. > > PHP should offer/modify the appropriate API to do this. I remember that > is_numeric() didn't exist before. > > Something like: > is_float_string(mixed value) > > or modify is_numeric() to explictly perform an integer validation: > is_numeric(mixed value [, bool is_integer = false]) > > is_numeric("5.5", true) ==> false, "5.5" is not an integer string > is_numeric("10", true) ==> true > > May be filing a bug report will do the trick. ;-) Don't add more bloat to the code. Don't be afraid of actually using a couple of lines to accomplish something instead of demanding a "built-in" function. ---John Holmes...

« previous php.general (#182645) next »