PHP - Math is_infinite() Function
The PHP Math is_infinite() function is used to check if the argument is infinite or not. It returns true (1) if the argument is infinite, else returns false/nothing.
Syntax
is_infinite(x)
Parameters
x |
Required. Specify the value. |
Return Value
Returns true (1) if the argument is infinite, else returns false/nothing.
Example:
In the below example, is_infinite() function is used to check if the argument is infinite.
<?php echo var_dump(is_infinite(2)); echo var_dump(is_infinite(-2)); echo var_dump(is_infinite(log(0))); ?>
The output of the above code will be:
bool(false) bool(false) bool(true)
❮ PHP Math Functions