PHP is_infinite() Function

Definition

The is_infinite() function checks whether a value is infinite or not.

Syntax

PHP is_infinite() Function has the following syntax.

is_infinite(value);

Parameter

ParameterIs Required Description
valueRequired. Value to check

Return

Item Description
Return Value TRUE if value is an infinite number, FALSE otherwise
Return Type Boolean

This function returns true (1) if the specified value is an infinite number which is outside the allowed range for a PHP float on this platform, otherwise it returns false/nothing.

Example

Check whether a value is infinite or not:


<?php//from   w  ww .ja  v  a2s  .c  o  m
echo is_infinite(2) . "\n";
echo is_infinite(log(0)) . "\n";
echo is_infinite(2000);
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions