Home > Backend Development > PHP Problem > How to convert string to lowercase in php

How to convert string to lowercase in php

王林
Release: 2023-03-02 10:44:01
Original
2446 people have browsed it

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)
Copy after login

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");
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template