PHP String strtolower() functionThe 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: Related functions
SyntaxThe syntax for the strtolower() function is given below, which takes only one string parameter. Parameters$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. Return ValueIt returns converted lowercase string. ExamplesThe 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. Example 1 Output: all is well Example 2 Output: String before conversion: ALAYMA IS A CUTE AND SINCERE GIRL. String after conversion: alayma is a cute and sincere girl. Example 3 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. Output: String before conversion: !, @, %, $, And # Are The Special Symbols. String after conversion: !, @, %, $, and # are the special symbols. Next TopicPHP String Functions |