2019独角兽企业重金招聘Python工程师标准>>>
Ctype函数是Php的Ctype扩展函数提供了一组函数用于校验字符串中的字符是否是正确的格式,这里我们主要介绍一下这些字符串验证函数的语法、有什么特殊的函数,如何去验证等.
Ctype函数是PHP内置的字符串体测函数,主要有以下几种:
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”
转载于:https://my.oschina.net/meng527/blog/877636
最后
以上就是生动鱼最近收集整理的关于php中Ctype函数用法详解的全部内容,更多相关php中Ctype函数用法详解内容请搜索靠谱客的其他文章。
发表评论 取消回复