PHP String strtoupper() function
The strtoupper() is one of the most popular functions of PHP, which is widely used to convert the string into uppercase. It takes a string as a parameter and converts all lowercase English character of that string to uppercase. Other characters such as numbers and special characters of the string remain the same. PHP 4+ versions support this function.
Note: The strtoupper () is a binary-safe function.
There are some other functions in PHP which are similar to the strtoupper() function:
The syntax for the strtoupper() function is given below, which takes only one string parameter.
$string (required): This is a mandatory parameter of this function which specifies a string to convert into uppercase. In simple words - it is a string which is converted into uppercase.
It returns converted uppercase string.
The strtoupper() is a widely used function of PHP. Below some examples are given. With the help of these examples, we can understand the working of this function practically
WELCOME TO JAVATPOINT
String before conversion: hie! I'm Gunjan Garg. String after conversion: HIE! I'M GUNJAN GARG.
In this example, we will see that special characters remain the same after applying strtoupper() function on the string. It only converts alphabet characters, whereas there is no change in special symbols.
String before conversion: !, @, %, $, and # are the special symbols. String after conversion: !, @, %, $, AND # ARE THE SPECIAL SYMBOLS.