Jump to: navigation, search

Php is finite

From w3cyberlearnings

Contents

PHP function is_finite

This function is used to check whether a given number is finite or not.

Syntax is_finite

  • number: a number input
is_finite($number)

Return

  • Return true (1) when it is finite.
  • Return false or nothing when it is not finite.

Example 1

<?php
$price = 3.5;

echo is_finite($price);
?>

Output

1

Example 2

<?php

$people = 30;
$profit = 400;

$share = $profit / $people;

if (is_finite($share)) {
	echo 'Yes finite';
} else {
	echo 'Not finite';
}
?>

Output

Yes finite

Related Links


Navigation
Web
SQL
MISC
References