Home  >  Article  >  Backend Development  >  How to convert string to lowercase in php

How to convert string to lowercase in php

王林
王林Original
2020-07-10 16:01:562380browse

The way PHP converts a string into lowercase is: it can be achieved through the strtolower() function. This function converts a string to lowercase. Function syntax: [strtolower(string)], the specific usage method is [strtolower($string);].

How to convert string to lowercase in php

(Recommended tutorial: php tutorial)

Function introduction:

strtolower() function Convert the string to lowercase.

Syntax:

strtolower(string)

Parameter introduction:

  • string Required parameters. Specifies the string to be converted.

Return value:

Returns the string converted to lowercase.

Code implementation:

<?php
$string = "Learn PHP string functions at jb51.net";
$lower = strtolower($string);
$upper = strtoupper($string);
print("$lower\n");
print("$upper\n");
print("\n");
?>

The above is the detailed content of How to convert string 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