PHP powerful string processing functions

Source: Internet
Author: User
Tags alphabetic character printable characters uppercase character
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.