-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCtypeLower.php
29 lines (26 loc) · 983 Bytes
/
CtypeLower.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
class CtypeLower
{
/**
* 做小写字符检测,检查提供的 string 和 text 里面的字符是不是都是小写字符是则返回 true
* ctype_lower ( string $text) : bool
* @param $strings string 需要被检测的字符
*/
public function CtypeLowerLearn($strings)
{
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";
}
}
}
}
$strings = array('aac123', 'qiutoas', 'QASsdks');
$CtypeLowerExample = new CtypeLower();
$CtypeLowerExample->CtypeLowerLearn($strings);
// 输出:
// 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.