PHP strtolower() Function
Topic: PHP String ReferencePrev|Next
Description
The strtolower()
function converts a string to lowercase.
The following table summarizes the technical details of this function.
Return Value: | Returns the modified string. |
---|---|
Version: | PHP 4+ |
Syntax
The basic syntax of the strtolower()
function is given with:
strtolower(string);
The following example shows the strtolower()
function in action.
Example
Run this code »<?php
// Sample string
$str = "Hello WORLD!";
// Making the string lowercase
echo strtolower($str);
?>
Here's a list of the functions related to strtolower()
function:
lcfirst()
– Converts the first character of a string to lowercase.ucfirst()
– Converts the first character of a string to uppercase.ucwords()
– Converts the first character of each word in a string to uppercase.strtoupper()
– Converts a string to uppercase.
Parameters
The strtolower()
function accepts the following parameters.
Parameter | Description |
---|---|
string | Required. Specifies the string to work on. |