Is there a PHP equivalent of isNaN in Javascript? If not, is there some way to check if a form contains only numbers with PHP?
Printable View
Is there a PHP equivalent of isNaN in Javascript? If not, is there some way to check if a form contains only numbers with PHP?
is_numeric(), perhaps?
Yep, that's it. Thanks.
Just for reference, PHP also has is_nan, though if you're dealing with forms you;ll want to use is_numeric as it works with string representations of numbers.