PHP Tutorial PHP Advanced PHP Resources
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

PHP - String strtolower() Function



The PHP String strtolower() function returns the string with all characters of the specified string in lowercase. Any symbol, space, special character or number in the string is ignored while applying this function. Only Alphabets are converted.

Syntax

strtolower(string)

Parameters

string Required. Specify the string to convert

Return Value

Returns the lowercased version of the specified string.

Example:

In the example below, strtolower() function returns a string containing all characters of the specified string MyString in lowercase.

<?php
$MyString = "HeLLo John!";
$NewString = strtolower($MyString);

echo $NewString."\n";
?>

The output of the above code will be:

hello john!

❮ PHP String functions

5