Page 1 of 1

Numbers only

Posted: Mon Aug 06, 2007 7:52 am
by aceconcepts
I have a line of code to check if text only has been entered:

Code: Select all

preg_match('/^[a-z]+$/Di', $var)
How would I change this to deal with numbers only?

Posted: Mon Aug 06, 2007 9:04 am
by VladSun

Code: Select all

is_numeric(), is_int(), is_float()

Posted: Mon Aug 06, 2007 3:00 pm
by feyd