PHP4.04 新增加瞭專用的字符函數 Ctype

Character type functions
These functions check whether a character or string falls into a certain character class according to the i current locale.
這些函數根據當前現場的 i 檢查一個字符或字符串是否在一個字符類裡面!

When called with an integer argument these functions behave exactly like their C counterparts.
當使用整數參數調用時,這些函數和 C 裡面的函數完全匹配。

When called with a string argument they will check every character in the string and will only return true if every character in the string matches the requested criteria.
當使用字符串參數,將檢查字符串裡面的每一個字符,如果字符串裡面的每個字符都等同於請求標準時返回 true.

Passing anything else but a string or integer will return false immediately.
傳送非字符串或整數的參數將立即返回 false


Warning
警告:

These functions are new as of PHP 4.0.4 and might change their name in the near future. Suggestions are to change them to ctype_issomething() instead of ctype_somthing() or even to make them part of ext/standard and use their original C-names, although this would possibly lead to further confusion regarding the isset() vs. is_sometype() problem.

這些函數是 php4.04 新增加的。可能在近期改變。建議包括更改 ctype_issomething() 代替 ctype_somthing(),甚至讓他們成為擴展/標準的一部分,和使用他們的原始 C_名字。盡管可能導致將來 isset() 對 is_sometype() 的混亂。


發佈留言