PHP strtoupper() Function

Example

Convert all characters to uppercase:

<?php
echo strtoupper("Hello WORLD!");
?>

Run Example

Definition and Usage

The strtoupper() function converts the string to uppercase.

Note:This function is binary safe.

Related Functions:

  • lcfirst() - Convert the first letter of the string to lowercase
  • strtolower() - Convert the string to lowercase
  • ucfirst() - Convert the first letter of the string to uppercase
  • ucwords() - Convert the first letter of each word in the string to uppercase

Syntax

strtoupper(string)
Parameter Description
string Required. Specifies the string to be converted.

Technical Details

Return Value: Return the string converted to uppercase.
PHP Version: 4+