PHP Tutorial PHP Advanced PHP Resources
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

PHP - String strtoupper() Function



The PHP String 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.

Syntax

strtoupper(string)

Parameters

string Required. Specify the string to convert

Return Value

Returns the uppercased version of the specified string.

Example:

In the example below, strtoupper() function returns 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

5