Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP String strtoupper() function is used to return 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.

Syntax

strtoupper(string)

Parameters

string Required. Specify the string to convert

Return Value

Returns the uppercased version of the specified string.

Example:

In the below example, strtoupper() function is used to return a string containing all characters of the specified string MyString in uppercase.

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

echo $NewString."\n";
?>

The output of the above code will be:

HELLO JOHN!

❮ PHP String functions