Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and numeric validation

Status
Not open for further replies.

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
 
if (preg_match("/^\d+$/",$var)) {
echo "num";
else {
echo "not num";
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top