is_numeric

PHP 4, PHP 5, PHP 7, PHP 8
is_numeric - Finds whether a variable is a number or a numeric string
Manual
Code Examples

is_numeric( mixed$value ): bool

Determines if the given variable is a number or a numeric string.

Parameters

value

The variable being evaluated.

Return Values

Returns true if value is a number or a numeric string, false otherwise.

Changelog

Version Description
8.0.0 Numeric strings ending with whitespace ("42 ") will now return true. Previously, false was return instead.

Related Functions

Example of is_numeric

Show all examples for is_numeric

PHP Version: