Computer >> Computer tutorials >  >> Programming >> PHP

strtoupper() function in PHP


The strtoupper() function is used to convert all the characters of a string to uppercase. It returns a character with all the characters as uppercase.

Syntax

strtoupper(str)

Parameters

  • str − The string to convert. Required.

Return

The strtoupper() function returns a character with all the characters as uppercase.

Example

The following is an example −

<?php
   $mystr = "laptop";
   $res = strtoupper($mystr);
   print_r($res);
?>

Output

The following is the output −

LAPTOP