![]() |
VOOZH | about |
The PHP strtoupper() function converts all alphabetic characters in a given string to uppercase. It takes a string as an argument and returns a new string with all letters capitalized, leaving non-alphabetic characters unchanged.
string strtoupper ( $string )Parameter: The only parameter to this function is a string that is to be converted to upper case.
Return value: This function returns a string in which all the alphabets are uppercase. Examples:
Input : $str = "GeeksForGeeks"
strtoupper($str)
Output: GEEKSFORGEEKS
Input : $str = "going BACK he SAW THIS 123$#%"
strtoupper($str)
Output: GOING BACK HE SAW THIS 123$#%
Below programs illustrate the strtoupper() function in PHP:
Example: In this example we converts the string "GeeksForGeeks" to uppercase using strtoupper() and prints the result.
GEEKSFORGEEKS
Example : In this example we converts the string "going BACK he SAW THIS 123$#%" to uppercase using strtoupper() and prints the result
GOING BACK HE SAW THIS 123$#%