PHP 中的 ctype_lower() 函数
phpprogrammingserver side programming更新于 2025/11/20 17:14:00
ctype_lower() 函数检查小写字符。如果文本中的每个字符在当前语言环境中都是小写字母,则返回 TRUE。
语法
ctype_lower(str)
参数
str − 测试的字符串
返回
如果文本中的每个字符在当前语言环境中都是小写字母,则 ctype_lower() 函数返回 TRUE。
示例
下面是一个例子 −
<?php
$arr = array('Tim879', 'tom');
foreach ($arr as $x) {
if (ctype_lower($x)) {
echo "$x consists of all lowercase letters.
";
}else {
echo "$x does not have all lowercase letters.
";
}
}
?>
输出
以下是输出 −
Tim879 does not have all lowercase letters. tom consists of all lowercase letters.

