SoFunction
Updated on 2025-03-09

php method to convert all strings into uppercase or lowercase

This article examples illustrate how php converts all strings into uppercase or lowercase. Share it for your reference. The specific analysis is as follows:

In PHP, you can convert all English characters in a string into lowercase or uppercase through two functions strtolower and strtoupper.

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

The output result is as follows:

learn php string functions at 
LEARN PHP STRING FUNCTIONS AT 

I hope this article will be helpful to everyone's PHP programming.