What is strtolower() in PHP?

The strtolower() function in PHP converts a string to lowercase.

The following figure shows a visual representation of the strtolower() function.

Visual representation of the strtolower() function

Syntax

string strtolower(string)

Parameter

As a parameter, the strtolower() function requires a string that is to be converted to lowercase.

Return value

The strtolower() function returns a string that is converted to lowercase.

Code

The code below shows how the strtolower() function works in PHP.

<?php
#string
echo("strtolower('EDUCATIVE'): ");
echo (strtolower('EDUCATIVE'));
echo("\n");
#string with number
echo("strtolower('EDUCATIVE09'): ");
echo (strtolower('EDUCATIVE09'));
?>
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources