: This article mainly introduces PHP's powerful string processing functions. if you are interested in the PHP Tutorial, please refer to it. List some of the forgotten but powerful string processing functions in the php language. here we will not illustrate their usage one by one. if you are interested, you can test them on your own.
(PHP 4> = 4.0.4, PHP 5)
Function prototype bool ctype_alnum (string text)
Ctype_alnum -- Check for alphanumeric character (s)
Check if it only contains [A-Za-z0-9]
Function prototype bool ctype_alpha (string text)
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 "\ r \ B \ t ".
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 as "\ r \ B \ t ".
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 "0123456789 abcdef"
The above introduces the powerful string processing functions of PHP, including some content, and hope to be helpful to friends who are interested in PHP tutorials.