ctype_digit

PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
ctype_digit - Check for numeric character(s)
Manual
Code Examples

Example #1 A ctype_digit example

Result: The string 1820.20 does not consist of all digits. The string 10002 consists of all digits. The string wsl!12 does not consist of all digits.
PHP Version:

Example #2 A ctype_digit example comparing strings with integers

PHP Version:


Function ctype_digit:

Character type checking Functions

Most used PHP functions