当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP4.04 新增加了专用的字符函数 Ctype

PHP
dedecms模版制作使用方法
dede3.1分页文字采集过滤规则详说(图文教程)
dede3.1分页文字采集过滤规则详说(图文教程)续二
dede3.1分页文字采集过滤规则详说(图文教程)续四
手把手教你使用DedeCms V3的在线采集图文教程
PHP实现MVC开发得最简单的方法:模型
php下用GD生成生成缩略图的两个选择和区别
Win2003服务器安全加固设置--进一步提高服务器安全性
[php] 我的微型论坛的简单教程[已完成]
phpMyAdmin下载、安装和使用入门教程
PHP 优化配置:加速你的VBB,phpwind,Discuz,IPB,MolyX
php+mysql开源XNA 聚合程序发布 下载
Bo-Blog专用的给Windows服务器的IIS Rewrite程序
MySQL数据库转移,access,sql server 转 MySQL 的图文教程
小结下MySQL中文乱码,phpmyadmin乱码,php乱码 产生原因及其解决方法
首页四格,首页五格For6.0(GBK)(UTF-8)[12种组合][9-18][版主安装测试通过]
[PHP]经常用到的实用函数集合
php扩展ZF:Validate扩展
php开发工具之vs2005图解
PHP 5.0创建图形的实用方法完整篇

PHP4.04 新增加了专用的字符函数 Ctype


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 166 ::
收藏到网摘: n/a

Charactertypefunctions
Thesefunctionscheckwhetheracharacterorstringfallsintoacertaincharacterclassaccordingtotheicurrentlocale.
这些函数根据当前现场的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()的混乱。