PHPctype function application and summary

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

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.