is_nan()

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published May 15, 2023
Contribute to Docs

The is_nan() function checks whether the argument is not a number.

Syntax

$result = is_nan(n);

Returns 1 if n is not a number, else returns nothing.

Codebyte Example

The following codebyte example uses is_nan() on the values of 10 and sqrt(-1) to check if each one is ‘not a number’:

Code
Output
Loading...

All contributors

Looking to contribute?

Learn PHP on Codecademy