PHP strtoupper() function with example

By IncludeHelp Last updated : December 27, 2023

PHP strtoupper() function

The strtoupper() function is a string function it accepts the string and returns an uppercase string.

Syntax

The syntax of the strtoupper() function:

strtoupper(string);

Parameters

The parameters of the strtoupper() function:

  • string: An input parameter.

Sample Input/Output

Input: "This is my COMPUter!"
Output: "THIS IS MY COMPUTER!"

Example of PHP strtoupper() Function

<?PHP
$str = "This is my COMPUter!";

echo (strtoupper($str));
?>

Output

The output of the above example is:

THIS IS MY COMPUTER!

To understand the above example, you should have the basic knowledge of the following PHP topics:

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.