PHP strtolower() function for lowercase string

The PHP strtolower() function is used to convert string characters to lowercase.

The function accepts a string to be converted and returns a string with all lowercase characters:

strtolower(string $string): string

This function doesn’t affect any numeric or special character in the string.

Here are some examples of using the function:

$str = "Nathan Sebhastian";

// ๐Ÿ‘‡ convert to lowercase
$str = strtolower($str);

// ๐Ÿ‘‡ nathan sebhastian
echo $str; 

$str = "JACK is a SOFTware DEVeloper";

// ๐Ÿ‘‡ convert to lowercase
$str = strtolower($str);

// ๐Ÿ‘‡ jack is a software developer
echo $str; 

The function reference is documented at: https://www.php.net/manual/en/function.strtolower.php

More PHP tutorials

See all