How to convert string to uppercase in php

王林
Release: 2023-03-05 10:38:01
Original
4569 people have browsed it

php method to convert a string to uppercase: You can use the built-in function strtoupper() to convert. The strtoupper() function converts the specified string to uppercase and returns the string converted to uppercase.

How to convert string to uppercase in php

Use function:

(Learning video recommendation: php video tutorial)

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

Grammar:

strtoupper(string)
Copy after login

(Related recommendations: php training)

Code implementation:

<?php
$string = "Learn PHP string functions at phpcn";
$lower = strtolower($string);
$upper = strtoupper($string);
print("$lower\n");
print("$upper\n");
print("\n");
?>
Copy after login

Output results:

learn php string functions at phpcn
LEARN PHP STRING FUNCTIONS AT PHPCN
Copy after login

The above is the detailed content of How to convert string to uppercase 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!