PHP Function Reference

PHP strtoupper() Function



The PHP strtoupper() function returns the string with all characters of the specified string in uppercase. Any symbol, space, special character or number in the string is ignored while applying this function. Only Alphabets are converted.

Note: Alphabet is determined by the current locale. For instance, in the default "C" locale characters such as umlaut-a (ä) will not be converted.

Note: This function is binary-safe.

Syntax

strtoupper(string)

Parameters

string Required. Specify the string to convert

Return Value

Returns the uppercased version of the specified string.

Example:

The example below shows the usage of strtoupper() function.

<?php
$MyString = "HeLLo John!";
$NewString = strtoupper($MyString);

echo $MyString."\n";
echo $NewString."\n";
?>

The output of the above code will be:

HeLLo John!
HELLO JOHN!

❮ PHP String Reference