首页
学习
活动
专区
圈层
工具
发布

ctype_lower

(PHP 4 >= 4.0.4, PHP 5, PHP 7)

ctype_lower - 检查小写字符(s)

描述

代码语言:javascript
代码运行次数:0
复制
bool ctype_lower ( string $text )

检查提供的字符串text中的所有字符是否都是小写字母。

参数

text

被测试的字符串。

返回值

如果文本中的每个字符都是当前语言环境中的小写字母,则返回TRUE。

例子

示例#1 ctype_lower()示例(使用默认语言环境)

代码语言:javascript
代码运行次数:0
复制
<?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";
    }
}
?>

上面的例子将输出:

代码语言:javascript
代码运行次数:0
复制
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.

注意

注意:如果提供了-128到255之间的整数,则它将被解释为单个字符的ASCII值(为了允许扩展ASCII范围中的字符,负值将被添加256)。任何其他整数都被解释为包含整数的十进制数字的字符串。

扩展内容

  • ctype_alpha() - 检查字母字符(s)
  • ctype_upper() - 检查大写字符(s)
  • setlocale() - 设置区域设置信息

← ctype_graph

ctype_print →

扫码关注腾讯云开发者

领取腾讯云代金券