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

string strtolower ( string $str )
This means that 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:
Explanation of strtolower() function definition
Function PartDescription
stringType of value this function returns, which is a string, in this case returns the uppercased string.
strtolowerThe function name
stringParameter type, this function accepts only string data type
$strParameter 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.

Contents and Related Tutorials

  1. Make string first's character uppercase
  2. Make string first's character lowercase
  3. Make a string lowercase
  4. Make a string uppercase
  5. Uppercase first character of each word in a string