PHP is_float() function
In this chapter you will learn:
- Description for PHP is_float() function
- Syntax for PHP is_float() function
- Parameter for PHP is_float() function
- Return value for PHP is_float() function
- Example - Is it a float type variable
Description
is_float(value) tells if a value is a float.
Syntax
is_float(value)
Parameter
- value is the variable being type checked.
Return
PHP is_float() function returns true if value is a float.
Example
Is it a float type variable?
<?php/*j av a 2s.com*/
$values = array(2, "2", 2.5, "2.5", null, true);
foreach ($values as $value) {
echo "is_float(";
var_export($value);
echo ") = ";
var_dump(is_float($value));
}
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Description for PHP is_int() function
- Syntax for PHP is_int() function
- Parameter for PHP is_int() function
- Return value for PHP is_int() function
- Example - Is it an integer value
Home » PHP Tutorial » PHP Data Type Functions