Home >Backend Development >PHP Problem >What function is used to convert string case in php?

What function is used to convert string case in php?

王林
王林Original
2020-08-29 13:32:462934browse

In PHP, you can use the strtoupper() and strtolower() functions to convert string case. The strtoupper() function converts a string to uppercase and returns the converted string. The strtolower() function can convert a string to lowercase and return the converted result.

What function is used to convert string case in php?

php provides us with functions specifically for converting upper and lower case, such as strtoupper() and strtolower().

(Recommended tutorial: php video tutorial)

Function introduction:

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

Example:

<?php
echo strtoupper("Hello WORLD!");
?>

(Related recommendations: php training)

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

Example:

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

The above is the detailed content of What function is used 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