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

How to convert all strings to lowercase in php

藏色散人
Release: 2023-03-08 14:14:02
Original
2626 people have browsed it

php method to convert all strings to lowercase: first create a PHP sample file; then convert the string to lowercase through the strtolower function.

How to convert all strings to lowercase in php

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

strtolower() function converts a string to lowercase.

Note: This function is binary safe.

Related functions:

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

strtoupper() - Convert the string to uppercase

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

Parameters

string required. Specifies the string to be converted.

Example

Convert all characters to lowercase:

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

Output:

hello world.
Copy after login

[Recommended: "PHP Video Tutorial》】

The above is the detailed content of How to convert all strings to lowercase in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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