bool is_int ( mixed $var )
is_int() checks whether a variable is an integer or not.
※ available F/W version : all
Returns TRUE if $var is an integer, otherwise FALSE.
<?php
$val1 = 100;
$val2 = 100.0;
$ret1 = is_int($val1);
$ret2 = is_int($val2);
if($ret1) echo "ret1 is an int\r\n"; // OUTPUT: ret1 is an int
else echo "ret1 is NOT an int\r\n";
if($ret2) echo "ret2 is an int\r\n";
else echo "ret2 is NOT an int\r\n"; // OUTPUT: ret2 is NOT an int
?>
is_array() / is_bool() / is_float() / is_string()
This function is identical to the PHP group’s is_int().