strtoupper() Function Use in PHP 8.4 and PHP 8.5

The strtoupper() function behaves identically in PHP 8.4 and PHP 8.5. There are no version-specific changes for this function in either release. The most recent behavioral change was in PHP 8.2.0, which made it locale-independent.

Function Overview

strtoupper() converts all ASCII alphabetic characters in a string to uppercase.

Syntax:

strtoupper(string $string): string

Example

<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; 
// Outputs: MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
?>

19 Views