PHP: is_finite() function
Description
The is_finite() function is used to find whether a value is finite or not.
Version:
(PHP 4 and above)
Syntax:
is_finite (num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | The value to be checked. | Required | Float |
Return value:
TRUE if num is finite number otherwise FALSE.
Value Type: Boolean.
Pictorial representation of is_finite() function
Example of php is_finite() function
<?php
$fval1=10.21;
$fval2=-50.85;
$zisf1=is_finite($fval1);
$zisf2=is_finite($fval2);
$zisf3=is_finite($fval3);
echo "$fval1 is is_finite : $zisf1<br />";
echo "$fval2 is is_finite : $zisf2<br />";
echo "$fval3 is is_finite : $zisf3<br />";
?>
Output:
10.21 is is_finite : 1 -50.85 is is_finite : 1 -INF is is_finite :
View of php is_finite() function in the browser
See also
Previous: hypot
Next: is_infinite
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/function-reference/is_finite.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics