Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math is_finite() function is used to check if the argument is a finite value or not. It returns true (1) if the argument is finite, else returns false/nothing.

Syntax

is_finite(x)   

Parameters

x Required. Specify the value.

Return Value

Returns true (1) if the argument is finite, else returns false/nothing.

Example:

In the below example, is_finite() function is used to check if the argument is finite.

<?php
echo var_dump(is_finite(2));
echo var_dump(is_finite(-2));
echo var_dump(is_finite(log(0)));    
?>

The output of the above code will be:

bool(true)
bool(true)
bool(false)

❮ PHP Math Functions