The is_nan()
function checks whether a value is 'not a number'.
PHP is_nan() Function has the following syntax.
is_nan(value);
Parameter | Is Required | Description |
---|---|---|
value | Required. | Value to check |
Item | Description |
---|---|
Return Value | TRUE if value is 'not a number', FALSE otherwise |
Return Type | Boolean |
This function returns true (1) if the specified value is 'not a number', otherwise it returns false/nothing.
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.