There are a number of ways to determine if a variable in PHP
is numeric. If you have PHP 4, you can use the is_numeric
function:if (is_numeric($thefield)==false) {
echo "\$thefield is not a number";
}
If you have PHP 3, then you can use the following function
function is_numeric($value) {
if (((int) $value)== $value) {
return true;
} else {
return false;
}
}
Comments