Updated Tuesday, June 10, 2008
This page is a demo of the is_numeric() function. It works for all inputs, in all browsers. Tested in FireFox 2.0 and Internet Explorer 7. Compatible in IE5 and IE6.
| Value | is_numeric() |
|---|---|
| 5 | |
| 4.567 | |
| 10-5 | |
| "cat" | |
| "another string" | |
| false |
Use this function to validate form input. If you put a number in the text box, it will recognize it. If you tried to do this using the regular is_numeric() function, it wouldn't work.
Input text: