The is_finite() function checks whether a value is finite or not.
PHP is_finite() Function has the following syntax.
is_finite(value);
Parameter | Is Required | Description |
---|---|---|
value | Required. | Value to check |
Item | Description |
---|---|
Return Value | TRUE if value is a finite number, FALSE otherwise |
Return Type | Boolean |
This function returns true (1) if the specified value is a finite number which is within the allowed range for a PHP float on this platform, otherwise it returns false/nothing.
Check whether a value is finite or not:
<?php
echo is_finite(2) . "\n";
echo is_finite(log(0)) . "\n";
echo is_finite(2000);
?>
The code above generates the following result.