is_finite()

ElMurimi's avatar
Published Jul 29, 2023
Contribute to Docs

The is_finite() function evaluates whether the passed value is finite or not and returns a boolean value.

Syntax

$result = is_finite($value);

Returns 1 (true) if the $value is finite, nothing (false) otherwise.

Example

The example below demonstrates the use of the is_finite() function to check whether a number is finite or not.

<?php
$result = is_finite(100);
echo $result;
?>

This will result in the following output:

1

Codebyte Example

The codebyte below uses the is_finite() function on a pair of values to evaluate whether they are finite:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn PHP on Codecademy