PHP Tutorial - PHP strtoupper() Function






Definition

The strtoupper() function converts string to uppercase.

Syntax

PHP strtoupper() Function has the following syntax.

string strtoupper ( string str )

Parameter

str is the string value we want to convert.

Return

PHP strtoupper() function returns the string in uppercase.

Example

Convert string to uppercase


<?PHP
$string = "PHP from java2s.com"; 
$a = strtoupper($string); 
print($a);
?>

The code above generates the following result.