PHP String strtolower() function
The strtolower() is one of the most popular functions of PHP, which is widely used to convert the string into lowercase. It takes a string as a parameter and converts all uppercase English character of that string to lowercase. Other characters such as numbers and special character of that string remain the same. PHP 4+ versions support this function.
Note: The strtolower () is a binary-safe function.
There are some other functions in PHP which are similar to the strtolower() function:
The syntax for the strtolower() 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 lowercase. In simple words ? it is a string which is converted into lowercase.
It returns converted lowercase string.
The strtolower() 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.
all is well
String before conversion: ALAYMA IS A CUTE AND SINCERE GIRL. String after conversion: alayma is a cute and sincere girl.
In this example, we will see that special characters remain the same after applying strtolower() 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.