PHP strtoupper() function

The strtoupper() function convert all alphabetic characters to uppercase.

Syntax

strtoupper ( string $string ) : string

Parameters

Parameter Name Descrption
$string Required, The input string.

Return Value

Returns the uppercased string.

strtoupper() examples

$string = 'Test string';
$string = strtoupper($string); 
echo $string;
//TEST STRING

$string = 'Test STRING';
$string = strtoupper($string);  
echo $string; 
//TEST STRING

Related Functions

  • ucfirst(): Make a string first character uppercase
  • lcfirst(): Make a string first character lowercase
  • strtolower(): Make a string lowercase
  • ucwords(): Uppercase the first character of each word in a string