gpt4 book ai didi

PHP函数检查字符串是否全部为小写

转载 作者:行者123 更新时间:2023-12-05 08:34:32 24 4
gpt4 key购买 nike

<分区>

我正在尝试创建一个函数,如果字符串全部为小写,则返回 TRUE,而不使用任何内置的 PHP 函数。我该怎么做?

这就是我正在使用的,但使用的是 ctype_lower .

$string = "string";

if (ctype_lower($string)) {
echo $string . ' is all lowercase letters.';
} else {
echo $string . ' is not all lowercase letters.';
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com