Home  >  Article  >  Backend Development  >  The function strtolower() that converts php strings to lowercase

The function strtolower() that converts php strings to lowercase

黄舟
黄舟Original
2017-11-06 10:38:532176browse

Example

Convert all characters to lowercase:

<?php
echo strtolower("Hello WORLD.");
?>

Definition and usage

strtolower() function converts a string to lowercase.

Note: This function is binary safe.

Related functions:

  • strtoupper() - Convert the string to uppercase

  • lcfirst() - Convert the string to uppercase Convert the first character in the string to lowercase

  • ucfirst() - Convert the first character in the string to uppercase

  • ucwords() - Convert the first character in the string to uppercase Convert the first character of each word in the string to uppercase

Syntax

strtolower(string)
Parameters Description
string Required. Specifies the string to be converted.

Technical details

Return value: Returns the string converted to lowercase.
PHP version: 4+
##strtolower function: This function will pass in the string parameter All characters are converted to lowercase and put back into the string in their minor form.

Example:

<?php
    $str = "I want To FLY";
    $str = strtolower($str);
    echo $str;
//by www.jbxue.com
?>

Output:


i want to fly


The above is the detailed content of The function strtolower() that converts php strings to lowercase. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn