English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The ctype_upper() function checks if all characters in the string are uppercase letters.
ctype_upper(\$text);
This function checks if all characters in the provided string (text) are uppercase letters.
Serial Number | Parameters and Description |
---|---|
1 | text (required) The string to be tested. |
If each character in the text is an uppercase letter in the current locale, it returns TRUE.
Check if all letters in the string are uppercase, see the following examples
<?php \$strings = array('test12345', 'ABCEFG','222ADFDS','testText'); foreach (\$strings as \$test) { if (ctype_upper(\$test)) { echo "\$test are all in uppercase letters\n"; }else { echo "\$test is not entirely in uppercase letters\n"; } } ?>Test and see‹/›
Output Result
test12345 is not entirely in uppercase letters ABCEFG are all in uppercase letters 222ADFDS is not entirely in uppercase letters testText is not entirely in uppercase letters