strtolower()
Make a string lowercase
Learn how to force a string value to lowercase.
strtolower()
function converts all the uppercase characters of a string to lowercase.
This function only affects the alphabets and other characters remain same.
strtolower()
prototype
This means thatstring strtolower ( string $str )
strtolower()
accepts string and returns the lowercased string (lowercased the all alphabetic characters).
We could rewrite the above function definition in an easy to understandable way:
Function Part | Description |
---|---|
string | Type of value this function returns, which is a string, in this case returns the uppercased string. |
strtolower | The function name |
string | Parameter type, this function accepts only string data type |
$str | Parameter name, a variable that holds the data |
Syntax
strtolower($str)
Return Value
strtolower()
function returns string
, with lowercased all the alphabetic characters.
Examples
Example 1
<?php $str = 'I AM PHP string'; //lowercase entire string $Lowercase = strtolower($str); echo $Lowercase; ?>
The above code prints i am php string
on browser screen.