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 −

 Live Demo

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

Output

The following is the output −

LAPTOP

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 26-Dec-2019

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements