How can I check a value entered in a field on my form is a number?
Here's an example:
<?php
$formvalue = "57a";
if(is_numeric($formvalue)) { echo "Is a number"; } else { echo "Not a number"; }
?>
This prints 'Not a number' in this instance.
More forms PHP Questions
How do I check that a valid email address is entered?How can I check that a data value is alphanumeric?
How do I make a website field mandatory?
How can I access information sent through GET on a form?
What are magic quotes?