欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【PHP4.04 新增加了专用的字符函数 Ctype】,下面是详细的分享!
PHP4.04 新增加了专用的字符函数 Ctype
CharactertypefunctionsThesefunctionscheckwhetheracharacterorstringfallsintoacertaincharacterclassaccordingtotheicurrentlocale.
这些函数根据当前现场的i检查一个字符或字符串是否在一个字符类里面!
WhencalledwithanintegerargumentthesefunctionsbehaveexactlyliketheirCcounterparts.
当使用整数参数调用时,这些函数和C里面的函数完全匹配。
Whencalledwithastringargumenttheywillcheckeverycharacterinthestringandwillonlyreturntrueifeverycharacterinthestringmatchestherequestedcriteria.
当使用字符串参数,将检查字符串里面的每一个字符,如果字符串里面的每个字符都等同于请求标准时返回true.
Passinganythingelsebutastringorintegerwillreturnfalseimmediately.
传送非字符串或整数的参数将立即返回false
Warning
警告:
ThesefunctionsarenewasofPHP4.0.4andmightchangetheirnameinthenearfuture.Suggestionsaretochangethemtoctype_issomething()insteadofctype_somthing()oreventomakethempartofext/standardandusetheiroriginalC-names,althoughthiswouldpossiblyleadtofurtherconfusionregardingtheisset()vs.is_sometype()problem.
这些函数是php4.04新增加的。可能在近期改变。建议包括更改ctype_issomething()代替ctype_somthing(),甚至让他们成为扩展/标准的一部分,和使用他们的原始C_名字。尽管可能导致将来isset()对is_sometype()的混乱。
以上所分享的是关于PHP4.04 新增加了专用的字符函数 Ctype,下面是编辑为你推荐的有价值的用户互动:
相关问题:php如何判断字符串是否是字母和数字的组合
答:(PHP 4 >= 4.0.4, PHP 5, PHP 7) ctype_alnum — 做字母和数字字符检测 结果如下: The string AbCd1zyZ9 consists of all letters or digits.The string foo!#$bar does not consist of all letters or digits.文档地址: http://www.php.net/ma... >>详细
相关问题:
答: >>详细
相关问题:
答: >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
