ctype_lower() 函數(shù)檢測字符串中字符是否都為小寫字母。
ctype_lower ( $text );
此函數(shù)檢查提供的字符串,文本中的所有字符是否均為小寫字母。
| 序號 | 參數(shù)及說明 |
|---|---|
| 1 | text(必需) 被測試的字符串。 |
如果文本中的每個字符在當前語言環(huán)境中均為小寫字母,則返回TRUE。
檢測字符是否均為小寫字母。
<?php
$strings = array('aac123', 'testing', "testin IS Done");
foreach ($strings as $test) {
if (ctype_lower($test)) {
echo "$test 全部為小寫字母。 \n";
}else {
echo "$test 含有不為小寫字母或字符。 \n";
}
}
?>測試看看?/?輸出結果:
aac123 含有不為小寫字母或字符。 testing 全部為小寫字母。 testin IS Done 含有不為小寫字母或字符。