Is Numeric

Check if a string represents a valid number.

Code

General
is_numeric($str) ? 'true' : 'false';

Parameters

The string to check

Server

More PHP Snippets