PHP ctype function application and summary

Source: Internet
Author: User
Tags alphabetic character control characters numeric lowercase php tutorial printable characters uppercase character

Php Tutorial ctype function application and summary
Today, I flipped through the php document and accidentally saw that the ctype function was easy to use and record for later 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.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.