PHP is_numeric() Function

PHP is_numeric() Function


The is_numeric() function in the PHP programming language is used to evaluate whether a value is a number or numeric string. Numeric strings contain any number of digits, optional signs such as + or -, an optional decimal, and an optional exponential. Therefore, +234.5e6 is a valid numeric string. Binary notation and hexadecimal notation are not allowed. 

The is_numeric() function can be used within an if() statement to treat numbers in one way and non-numbers in another. It returns true or false.