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