PHP | strtolower() Function

The strtolower() function is used to convert a string into lowercase. This function takes a string as parameter and converts all the uppercase english alphabets present in the string to lowercase. All other numeric characters or special characters in the string remains unchanged.

Syntax:

string strtolower( $string )

Parameter: The only parameter to this function is a string that is to be converted to lower case.



Return value: This function returns a string in which all the alphabets are lower case.

Examples:

Input : $str  = "GeeksForGeeks"
        strtolower($str)
Output: geeksforgeeks

Input : $str  = "going BACK he SAW THIS 123$#%"
        strtolower($str)
Output: going back he saw this 123$#%

Below programs illustrate the strtolower() function in PHP:

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// original string
$str = "GeeksForGeeks";
  
// string converted to lower case
$resStr = strtolower($str);
  
print_r($resStr);
  
?>

chevron_right


Output:

geeksforgeeks

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// original string
$str = "going BACK he SAW THIS 123$#%";
  
// string converted to lower case
$resStr = strtolower($str);
  
print_r($resStr);
  
?>

chevron_right


Output:

going back he saw this 123$#%

Reference:
http://php.net/manual/en/function.strtolower.php



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : Vaibhav Bajpai



Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.