PHP strtoupper()

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

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

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

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

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours