Some powerful string processing functions forgotten by php
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"
Articles you may be interested in
- Summary of String Functions in PHP
- Php string Filter Function
- Php restricts regular expressions that can only contain English characters and numbers
- Image zoom-in display special effects slimbox the most lightweight function the most powerful Jquery Image zoom-in special effects
- Php calculates the number of weeks in a year or January.
- Php's most precise String Length truncation Function
- Php performance optimization: Using isset () to determine the string length is faster than strlen ()
- Php calculates the number of days of the difference between two dates.