What function is used to convert string case in php?

王林
Release: 2023-03-05 13:08:02
Original
2914 people have browsed it

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

(Related recommendations: php training)

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

Example:

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

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!

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