Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

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

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

PHP Available FunctionsAvailable PHP Functions

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

**Alias functions:** is_double(), is_real().

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

PHP version requirement: PHP 4, PHP 5, PHP 7

Syntax


bool is_float ( mixed $var )

Parameter Description:

Return Value

If the specified variable is a float, returns TRUE; otherwise returns FALSE.

Example

Example

The output is:


这是一个浮点类型的值
bool(false)

bool(false)

bool(false)

bool(false)

PHP Available FunctionsAvailable PHP Functions