Home  >  Article  >  Backend Development  >  How to convert strings from uppercase to lowercase in PHP?

How to convert strings from uppercase to lowercase in PHP?

青灯夜游
青灯夜游Original
2020-07-18 14:09:155452browse

In PHP, you can use the strtolower() function to convert strings from uppercase to lowercase. The strtolower() function is used to convert a string to lowercase; the syntax is "strtolower(string)", the parameter string specifies the string to be converted; and then returns the string converted to lowercase.

How to convert strings from uppercase to lowercase in PHP?

The strtolower() function converts all characters in the passed string parameter to lowercase and puts the string back in decimal form.

Note: This function is binary safe.

PHP version : 4

Related functions:

  • ##strtoupper() - Convert a string to uppercase

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

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

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

Syntax

strtolower(string)

Parameters:


  • string Required. Specifies the string to be converted.

Return value: Returns the string converted to lowercase.

Example:

<?php
  $str = "I want To FLY";
  $str = strtolower($str);
  echo $str;
?>

Output:


i want to fly

Related tutorial recommendations: "

PHP Tutorial"

The above is the detailed content of How to convert strings from uppercase to lowercase in PHP?. 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