English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The functions provided by this extension check whether a character or string belongs to a character class based on the current locale.
When called with an integer parameter, these functions behave exactly the same as the corresponding C functions in ctype.h.
from PHP 4.2.0 to enable these functions by default. For earlier versions, you must use --enable-ctype Configure and compile PHP. You can use --disable-ctype Disable ctype support.
PHP 4.3.0 provides built-in support for ctype.
PHP-Indicates the earliest version of PHP that supports this function.
Number | Function name | Description | PHP version |
---|---|---|---|
1 | ctype_alnum() | Check alphabetic and numeric characters | 4.0.4 |
2 | ctype_alpha() | Check alphabetic characters | 4.0.4 |
3 | ctype_cntrl() | Check control characters | 4.0.4 |
4 | ctype_digit() | Check numeric characters | 4.0.4 |
5 | ctype_graph() | Check all printable characters except spaces | 4.0.4 |
6 | ctype_lower() | Check lowercase characters | 4.0.4 |
7 | ctype_print() | Check printable characters | 4.0.4 |
8 | ctype_punct() | Check if the printable characters do not contain whitespace, numbers, and letters | 4.0.4 |
9 | ctype_space() | Check space characters | 4.0.4 |
10 | ctype_upper() | Check uppercase characters | 4.0.4 |
11 | ctype_xdigit() | Check if the string contains only hexadecimal characters | 4.0.4 |