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

How to convert string case in php

王林
王林 Original
2020-08-01 15:58:47 2817browse

How to convert string case in php: You can use strtolower() function and strtoupper() function to achieve string case conversion. The strtolower() function converts a string to lowercase and returns the string converted to lowercase.

How to convert string case in php

In PHP, you can use the strtolower() function and strtoupper() function to achieve string case conversion. Let's introduce these two functions separately.

(Recommended tutorial:php graphic tutorial)

strtolower() function converts the string to lowercase and returns the string converted to lowercase.

Syntax:

strtolower(string)

strtoupper() function converts the string to uppercase and returns the string converted to uppercase.

Grammar:

strtoupper(string)

(Video tutorial recommendation:php video tutorial)

Code example:

Put all Convert characters to uppercase:

Convert all characters to lowercase:

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