w3resource

PHP: is_finite() function

Description

The is_finite() function is used to find whether a value is finite or not.

Version:

(PHP 4 and above)

Syntax:

is_finite (num)

Parameter:

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

Return value:

TRUE if num is finite number otherwise FALSE.

Value Type: Boolean.

Pictorial representation of is_finite() function

php math is_fiinite()

Example of php is_finite() function

<?php
$fval1=10.21;
$fval2=-50.85;
$zisf1=is_finite($fval1);
$zisf2=is_finite($fval2);
$zisf3=is_finite($fval3);
echo "$fval1 is is_finite : $zisf1<br />";
echo "$fval2 is is_finite : $zisf2<br />";
echo "$fval3 is is_finite : $zisf3<br />";
?> 

Output:

10.21 is is_finite : 1
-50.85 is is_finite : 1
-INF is is_finite :

View of php is_finite() function in the browser

See also

PHP Function Reference

Previous: hypot
Next: is_infinite



Follow us on Facebook and Twitter for latest update.