(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
ctype_lower — 做小寫(xiě)字符檢測
$text
): bool
檢查提供的 string 和 text
里面的字符是不是都是小寫(xiě)字母。
text
需要被測試的字符串。
如果在當前的語(yǔ)言環(huán)境下 text
里面的每個(gè)字符都是小寫(xiě)字母,就返回 true
;反之就返回 false
。
示例 #1 一個(gè) ctype_lower() 例子 (使用默認的語(yǔ)言環(huán)境)
<?php
$strings = array('aac123', 'qiutoas', 'QASsdks');
foreach ($strings as $testcase) {
if (ctype_lower($testcase)) {
echo "The string $testcase consists of all lowercase letters.\n";
} else {
echo "The string $testcase does not consist of all lowercase letters.\n";
}
}
?>
以上例程會(huì )輸出:
The string aac123 does not consist of all lowercase letters. The string qiutoas consists of all lowercase letters. The string QASsdks does not consist of all lowercase letters.
注意:
如果給出一個(gè) -128 到 255 之間(含)的int, 將會(huì )被解釋為該值對應的ASCII字符 (負值將加上 256 以支持擴展ASCII字符). 其它整數將會(huì )被解釋為該值對應的十進(jìn)制字符串.