is_float()


bool is_float ( mixed $var )

Description

is_float() checks whether a variable is a float or not.

※ available F/W version : all

Parameters

Return values

Returns TRUE if $var is a float, otherwise FALSE.

Example

<?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
?>

See also

is_array() / is_bool() / is_int() / is_string()

Remarks

This function is identical to the PHP group’s is_float().