check if an value are string or number php code example
Example 1: php is variable a number
if(is_numeric($what_am_i)){
//true
}
Example 2: how to check if PHP variable contains non-numbers?
if ( is_numeric($_POST['foo']) ) {
$foo = $_POST['foo'];
} else {
// Error
}