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. \n"; }else { echo "$x does not have all lowercase letters. \n"; } } ?>
输出结果
以下是输出-
Tim879 does not have all lowercase letters. tom consists of all lowercase letters.