w3resource

PHP: is_infinite() function

Description

The is_infinite() function is used to find whether a value is infinite or not.

Version:

(PHP 4 and above)

Syntax:

is_infinite(num)

Parameter:

Name Description Required /
Optional
Type
num The value to be checked. Required Float

Return value:

TRUE if num is infinite number otherwise FALSE.

Value Type: Boolean

Pictorial Presentation

php math is_infinite() function

Example:

<?php
$fval1=10.21;
$fval2=-255550.85;
echo is_infinite($fval1);
echo"<br />";
echo is_infinite($fval2);
?> 

Output:

 1

View the example in the browser

See also

PHP Function Reference

Previous: is_finite
Next: is_nan



Become a Patron!

Follow us on Facebook and Twitter for latest update.

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_infinite.php