strtoupper()

Jess_1995's avatar
Published Jul 12, 2023
Contribute to Docs

The strtoupper() function converts all the characters in a string to uppercase.

Syntax

strtoupper(string_to_convert);

The string_to_convert parameter is the string that will be converted to uppercase.

Example

The following code demonstrates the use of strtoupper() to alter a string.

<?php
echo strtoupper("hello, world!");
?>

The code results in the following:

HELLO, WORLD!

All contributors

Contribute to Docs

Learn PHP on Codecademy