PHP is_numeric() Function

PHP Variable Handling Reference : Check whether a variable is a number or a numeric string, or not

Definition and Usage

The is_numeric() function checks whether a variable is a number or a numeric string.

This function returns true (1) if the variable is a number or a numeric string, otherwise it returns false/nothing.

Syntax

is_numeric(variable);

Parameter Values

Parameter Description
variable Required. Specifies the variable to check

Technical Details

Return Value: TRUE if variable is a number or a numeric string, FALSE otherwise
Return Type: Boolean
PHP Version: 4.0+

❮ PHP Variable Handling Reference