PHP is_infinite()
Published Jul 20, 2023
Contribute to Docs
The is_infinite() function evaluates whether the value is infinite or not and returns a boolean value.
Syntax
$result = is_infinite(value);
Returns 1 if value is infinite, else returns false.
Example
The example below demonstrates the use of the is_infinite() function to check whether a number is infinite or not.
<?php$value = log(0);$result = is_infinite($value);echo $result;?>
This example results in the following output:
1
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn PHP on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours