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

Take your skills to the next level ⚑️

I'm sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.