Mar 24, 2002 #1 balance Programmer Feb 5, 2002 52 CA Does anyone know if PHP has a built in "isNumeric" function? I need something to tell me if my form values are submitted with numbers or not. If there isn't one I guess it will come down to good old brute force. Thanks for any help. Cheers, AJ
Does anyone know if PHP has a built in "isNumeric" function? I need something to tell me if my form values are submitted with numbers or not. If there isn't one I guess it will come down to good old brute force. Thanks for any help. Cheers, AJ
Mar 24, 2002 #2 piti Technical User Apr 12, 2001 627 SK in php >= 4.0, there's the is_numeric() function http://www.php.net/manual/en/function.is-numeric.php Upvote 0 Downvote
in php >= 4.0, there's the is_numeric() function http://www.php.net/manual/en/function.is-numeric.php
Mar 25, 2002 Thread starter #3 balance Programmer Feb 5, 2002 52 CA Great! Thanks Piti Upvote 0 Downvote
Mar 26, 2002 #4 BB101 Programmer May 23, 2001 337 GB if (preg_match("/^\d+$/",$var)) { echo "num"; else { echo "not num"; } Upvote 0 Downvote