PHP ctype函數應用與總結

來源:互聯網
上載者:User

php教程 ctype函數應用與總結
今天翻php的文檔  偶然看到ctype函數   覺得很好用  記錄下來以備後用:


ctype_alnum -- check for alphanumeric character(s)
檢測是否是只包含[a-za-z0-9]

ctype_alpha -- check for alphabetic character(s)
檢測是否是只包含[a-za-z]


ctype_cntrl -- check for control character(s)
檢查是否是只包含類是“nrt”之類的字 符控制字元


ctype_digit -- check for numeric character(s)
檢查時候是只包含數字字元的字串(0-9)


ctype_graph -- check for any printable character(s) except space
檢查是否是只包含有可以列印出來的字元(除了空格)的字串


ctype_lower -- check for lowercase character(s)
檢查是否所有的字元都是英文字母,並且都是小寫


ctype_print -- check for printable character(s)
檢查是否是只包含有可以列印出來的字元的字串


ctype_punct -- check for any printable character which is not whitespace or an alphanumeric character
檢查是否是只包含非數字/字元/空格的可列印出來的字元


ctype_space -- check for whitespace character(s)
檢查是否是只包含類是“ ”之類的字元和空格


ctype_upper -- check for uppercase character(s)
檢查是否所有的字元都是英文字母,並且都是大寫的


ctype_xdigit -- check for character(s) representing a hexadecimal digit
檢查是否是16進位的字串,只能包括 “0123456789abcdef”

 

ctype 函數
table of contents
ctype_alnum — check for alphanumeric character(s)   檢查字串中只包含數字或字母,相當於正則[a-za-z0-9].   有傳回值。
ctype_alpha — check for alphabetic character(s)  檢查字串中只包含字母。  有傳回值。
ctype_cntrl — check for control character(s)    檢查字串中是否只包含" 'n' 'r' 't' " 這樣的控制字元。  有傳回值
ctype_digit — check for numeric character(s)  檢查字串中是否只包含數字。  有傳回值。
ctype_graph — check for any printable character(s) except space  檢查字串中是否只包含可以輸出的字元。 有傳回值。
ctype_lower — check for lowercase character(s)   檢查字串中是否只包含小寫英文字母。   有傳回值。
ctype_print — check for printable character(s)  檢查字串中是否只包含可以列印的字元。   有傳回值。
ctype_punct — check for any printable character which is not whitespace or an alphanumeric character  檢查字串中是否只包含可以列印的字元,並且這樣字元不能是非空格、數字、字元。    有傳回值。
ctype_space — check for whitespace character(s)   檢查字串中是否只包含空格或者" " .  有傳回值
ctype_upper — check for uppercase character(s)  檢查字串中是否只包含大寫的英文字母。  有傳回值。
ctype_xdigit — check for character(s) representing a hexadecimal digit  檢查字串中是否是16進位的字串。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.