基本介紹
- 中文名:ctype_upper
- 函式原型:bool ctype_upper
- ctype_uppe :檢查大寫字元
- 輸出:The string AKLWC139 does
函式原型,函式範例,
函式原型
bool ctype_upper ( string text )
檢查大寫字元
ctype_upper
(PHP 4 >= 4.0.4, PHP 5)
ctype_upper -- 檢查大寫字元
函式範例
<?php
$strings = array('AKLWC139', 'LMNSDO', 'akwSKWsm');
foreach ($strings as $testcase) {
if (ctype_upper($testcase)) {
echo "The string $testcase consists of all uppercase letters.\n";
} else {
echo "The string $testcase does not consist of all uppercase letters.\n";
}
}
?>
上例將輸出
The string AKLWC139 does not consist of all uppercase letters. The string LMNSDO consists of all uppercase letters. The string akwSKWsm does not consist of all uppercase letters.