PHP | ctype_upper() Function Last Updated : 04 Jun, 2018 Comments Improve Suggest changes Like Article Like Report The ctype_upper() function in PHP used to check each and every character of a given string is in uppercase or not. If the string in upper case then it returns TRUE otherwise returns False. Syntax: ctype_upper (string text) Parameter Used:- $text : The tested string. Return Value: Function returns True if each character of text in Upper Case or False if text is not in upper case. Examples: Input : GEEKSFORGEEKS Output : Yes Explanation: All characters of "GEEKSFORGEEKS" in UPPERCASE. Input : GFG2018 Output : No Explanation : In text "GFG2018", '2', '0', '1', '8' are not in UPPERCASE. Input : GFG INDIA Output : No Explanation : In String "GFG INDIA" a special character [space] between GFG and INDIA. so answer will be No. Note: Except string, if we input anything then it will return FALSE. Below program illustrates the ctype_upper() function in PHP: Program: 1 php <?php // PHP program to check given string is // all characters -Uppercase characters $string1 = 'GEEKSFORGEEKS'; if (ctype_upper($string1)) { // if true then return Yes echo "Yes\n"; } else { // if False then return No echo "No\n"; } ?> Output: Yes Program: 2 passing array of string as text and print result for individual values. PHP <?php // PHP program to check given string is // all characters -Uppercase characters $strings = array('GEEKSFORGEEKS', 'First', 'PROGRAMAT2018', 'ARTICLE'); // Checking above given four strings //by used of ctype_upper() function . foreach ($strings as $test) { if (ctype_upper($test)) { // if true then return Yes echo "Yes\n"; } else { // if False then return No echo "No\n"; } } ?> Output: Yes No No Yes Program: 3 Drive a code ctype_upper() function where input will be space, special symbol, returns False. PHP <?php // PHP program to check given string is // all characters -Uppercase characters $strings = array('GEEK @ . com'); // Checking above given four strings //by used of ctype_upper() function . foreach ($strings as $test) { if (ctype_upper($test)) { // if true then return Yes echo "Yes\n"; } else { // if False then return No echo "No\n"; } } ?> Output: No References : http://php.net/manual/en/function.ctype-upper.php Comment More infoAdvertise with us Next Article PHP | ctype_upper() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-string PHP-function Similar Reads PHP | ctype_print() Function The ctype_print() Function in PHP used to check each and every character of a string are visible or not. If all characters of string are visible then returns TRUE , else if there are any control character then return FALSE. Control Character: A character that does not represent a printable character 2 min read PHP | ctype_space() Function A ctype_space() function in PHP is used to check whether each and every character of a string is whitespace character or not. It returns True if the all characters are white space, else returns False. Syntax : ctype_space(string text) Parameter Used: text :- It is a mandatory parameter which specifi 2 min read PHP | ctype_punct() Function The ctype_punct() is an inbuilt function in PHP which is used to check printable character which is not whitespace or an alphanumeric character. Every character in a string is printable, but neither alphanumeric, digit or blank then return True otherwise return False. Syntax: bool ctype_punct ( $tex 2 min read PHP | ctype_punct() Function The ctype_punct() function in PHP is used to check if all of the characters of a given string are punctuation characters or not. If all characters are punctuation characters then this function return TRUE, otherwise, returns FALSE. Note: The punctuation characters are, period, comma, question mark, 2 min read PHP | ctype_graph() Function A ctype_graph() Function is inbuilt function in PHP. The given string is used to check each character and display all visible character without white-space character. If it's visible then return True otherwise False. Syntax: bool ctype_graph ( $text ) Parameters: The ctype_graph() function accepts a 2 min read Like