I turned to the php document today and accidentally saw the ctype function. I thought it was very useful. I recorded it for later use: ctype_alnum -- checkforalphanumericcharacter (s) to check whether it is only
Today, I flipped through the php document and accidentally saw the ctype function. I thought it was very useful. I recorded it for future use:
Ctype_alnum -- check for alphanumeric character (s)
Check if it only contains [A-Za-z0-9]
Ctype_alpha -- check for alphabetic character (s)
Check whether it only contains [a-za-z]
Ctype_cntrl -- check for control character (s)
Check whether it only contains character control characters such as "nrt ".
Ctype_digit -- check for numeric character (s)
Check that the string contains only numbers (0-9)
Ctype_graph -- check for any printable character (s) character t space
Check whether the string contains only printable characters (except spaces)
Ctype_lower -- check for lowercase character (s)
Check whether all characters are English letters and lowercase letters.
Ctype_print -- check for printable character (s)
Check whether the string contains only printable characters.
Ctype_punct -- check for any printable character which is not whitespace or an alphanumeric character
Check whether only printable characters including non-numbers, characters, and spaces are allowed.
Ctype_space -- check for whitespace character (s)
Check whether it only contains characters and spaces such "".
Ctype_upper -- check for uppercase character (s)
Check whether all characters are English letters and uppercase letters
Ctype_xdigit -- check for character (s) representing a hexadecimal digit
Check whether the string is a hexadecimal string and can only contain "0123456789abcdef"
Ctype function
Table of contents
Ctype_alnum-check for alphanumeric character (s) check string contains only numbers or letters, equivalent to regular [A-Za-z0-9]. there is a return value.
The ctype_alpha-check for alphabetic character (s) check string contains only letters. Return value.
Ctype_cntrl-check for control character (s) checks whether the string contains only control characters such as "'n' R'' t. Return value
Ctype_digit-check for numeric character (s) checks whether the string contains only numbers. Return value.
Ctype_graph-check for any printable character (s) character t space checks whether the string contains only the characters that can be output. Return value.
Ctype_lower-check for lowercase character (s) check whether the string contains only lowercase English letters. Return value.
Ctype_print-check for printable character (s) checks whether the string contains only printable characters. Return value.
Ctype_punct-check for any printable character which is not whitespace or an alphanumeric character checks whether the string contains only printable characters, and such characters cannot be non-spaces, numbers, or characters. Return value.
Ctype_space-check for whitespace character (s) check whether the string contains only spaces or "". return values
Ctype_upper-check for uppercase character (s) check whether the string contains only uppercase English letters. Return value.
Ctype_xdigit-check for character (s) representing a hexadecimal digit checks whether the string is a hexadecimal string.