Instead of doing a lot of casting, you can use is_numeric() to see if a variable is a number or a numeric string.
-William El mar, 06-04-2004 a las 14:19, John W. Holmes escribió: > Well, if "(int)$string == $string", then the value is an integer. Same for > "(float)$string == $string" for a real number. Boolean would be easy, just > strtolower($string) as compare to 1, 0, 'true', or 'false'. Date/time > validation will probaby require a regular expression or breaking it up to > validate days/month, etc. That can get a little hairy. If they say "text", > well, anything goes, right? Maybe just make sure it's not empty()? > > Let me know if you need more details. There are probably a ton of different > ways to do this. > > ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php