convert string to small letters php code example

Example 1: convert string to lowercase in php

/* strtolower() function converts  string to lowercase. */
<?php
echo strtolower("Hello WORLD 123");
?>
// Output:hello world 123

Example 2: how to convert string word to lowercase in php

strtolower ( string $string ) : string 
//Returns string with all alphabetic characters converted to lowercase.
$string = 'HELLO WORLD';
echo strtolower($string); //Output: 'hello world'
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.

Example 3: php code to convert to small letter

$str = strtolower($str);

Example 4: php to lowercase

<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtolower($str);
echo $str; 
// Result: mary had a little lamb and she loved it so

Tags:

Php Example