PHP is_nan() Function

Definition

The is_nan() function checks whether a value is 'not a number'.

Syntax

PHP is_nan() Function has the following syntax.

is_nan(value);

Parameter

ParameterIs RequiredDescription
value Required. Value to check

Return

Item Description
Return Value TRUE if value is 'not a number', FALSE otherwise
Return TypeBoolean

This function returns true (1) if the specified value is 'not a number', otherwise it returns false/nothing.

Example

Check whether a value is 'not-a-number':


<?php
echo is_nan(200) . "\n";
echo is_nan(acos(1.01));
?>

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