Easy Tutorial
❮ Php Imagearc Func Math Is Finite ❯

PHP is_float(), is_double(), is_real() Functions

PHP Available Functions

The is_float() function is used to check if a variable is of type float.

Alias Functions: is_double(), is_real().

Note: To test if a variable is a number or a numeric string (such as form input, which are usually strings), you must use **.

PHP Version Requirements: PHP 4, PHP 5, PHP 7

Syntax

bool is_float ( mixed $var )

Parameter Description:

Return Value

Returns TRUE if the specified variable is a float, otherwise returns FALSE.

Example

<?php
$var_name = 127.55;
if (is_float($var_name))
    echo 'This is a float value' . PHP_EOL;
else
    echo 'This is not a float value' . PHP_EOL;

var_dump(is_float('tutorialpro'));
echo PHP_EOL;
var_dump(is_float(85));
echo PHP_EOL;
var_dump(is_float(true));
echo PHP_EOL;
var_dump(is_float(array(23.3, 56, 6)));
?>

Output:

This is a float value
bool(false)

bool(false)

bool(false)

bool(false)

PHP Available Functions

❮ Php Imagearc Func Math Is Finite ❯