Home > Backend Development > PHP Tutorial > How to convert all strings to uppercase or lowercase in php_PHP tutorial

How to convert all strings to uppercase or lowercase in php_PHP tutorial

WBOY
Release: 2016-07-13 10:03:06
Original
888 people have browsed it

How to convert all strings to uppercase or lowercase in php

This article mainly introduces the method of converting all strings to uppercase or lowercase in php, involving strtolower in php For tips on using functions such as strtoupper, friends in need can refer to it

The example in this article describes how PHP converts all strings into uppercase or lowercase. Share it with everyone for your reference. The specific analysis is as follows:

In PHP, you can use the strtolower and strtoupper functions to convert all English characters in the string to lowercase or uppercase

?

1

2

3

4

5

6

7

8

$string = "Learn PHP string functions at jb51.net";

$lower = strtolower($string);

$upper = strtoupper($string);

print("$lowern");

print("$uppern");

print("n");

?>

1 2

3

4

5

6

1

2

learn php string functions at jb51.net

LEARN PHP STRING FUNCTIONS AT JB51.NET

7 8

$string = "Learn PHP string functions at jb51.net";

$lower = strtolower($string);$upper = strtoupper($string); print("$lowern"); print("$uppern"); print("n"); ?>
The output results are as follows:
?
1 2 learn php string functions at jb51.net LEARN PHP STRING FUNCTIONS AT JB51.NET
I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/969350.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/969350.htmlTechArticleHow to convert all strings into uppercase or lowercase in php. This article mainly introduces how to convert all strings in php The method of converting into uppercase or lowercase involves functions such as strtolower and strtoupper in 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