PHP some powerful string processing function summary

Source: Internet
Author: User
PHP some powerful string processing function summary

List several forgotten in the PHP language but very powerful string processing functions, here is not the use of an example, interested friends can test themselves.

(PHP 4 >= 4.0.4, PHP 5)

1, Ctype_alnum
Detects if it contains only [a-za-z0-9]

2,Ctype_alpha

Detects if it contains only [a-za-z]

3, Ctype_cntrl
Check if it is a character control character that contains only the class "\r\b\t"

4, Ctype_digit
Check time is a string containing only numeric characters (0-9)

5, Ctype_graph
Check if it is a string that contains only characters that can be printed (except for spaces)

6, Ctype_lower
Check if all characters are English letters and are lowercase

7, Ctype_print
Check if it is a string containing only the characters that can be printed

8, Ctype_punct
Check if it is a printable character that contains only non-digits/characters/spaces

9, Ctype_space
Check if it is a character and space that contains only classes such as "\r\b\t"

10, Ctype_upper
Check if all characters are in English letters and are all uppercase

11, Ctype_xdigit
Check if it is a 16 binary string and can only include "0123456789abcdef"

  • 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.