How to Change Case in PHP - strtolower() and strtoupper() Functions

PHP String Functions

The strtolower() function converts a string to lowercase and the strtoupper() converts a string to uppercase.

Syntax

strtolower(string $string)
strtoupper(string $string)

Example 1

echo strtolower("Hello, World!");

Output: hello, world!

Example 2

echo strtoupper("Hello, World!");

Output: HELLO, WORLD!