strtoupper()

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

Looking to contribute?

Learn PHP on Codecademy