is_numeric() / gettype()
Is it a number? / What is its type?
Syntax
is_numeric($value) · gettype($value)
Description
is_numeric returns whether a value is a number (true/false), gettype returns its type.
Example
Loading editor…
Expected output
bool(true) integer
When to use?
Input validation, debugging.