Brendon Boldt
0
Q:

php is numeric

$var_num = "1";
$var_str = "Hello World";

var_dump( is_numeric($var_num), is_numeric($var_str) );

/* 
Output -
 bool(true)
 bool(false)
*/
3
 <?php if (is_numeric(887)) { echo "Yes"; } else { echo "No"; } ?>
2
//is_numeric — Finds whether a variable is a number or a numeric string
is_numeric ( $variable ); // returns true or false
1

New to Communities?

Join the community