Friday, September 5, 2025
HomeLanguagesPHP strtolower() Function

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: neveropen

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:




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


Output:

neveropen

Program 2:




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


Output:

going back he saw this 123$#%

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

PHP is a server-side scripting language designed specifically for web development. You can learn PHP from the ground up by following this PHP Tutorial and PHP Examples.

RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11863 POSTS0 COMMENTS
Shaida Kate Naidoo
6750 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6701 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS