Follow
Follow

How to convert a string to uppercase in PHP

PHP strtoupper() function

The strtoupper() function is used to converts a string to uppercase. All other special characters or numeric characters in the string remains unchanged. This function is binary-safe.

Syntax

strtoupper(string)

string – This parameter is required. It converts all characters of a string to uppercase.

Example

<?php
$str = 'Welcome to PHP Tutorials!';
echo strtoupper($str);   // Output : WELCOME TO PHP TUTORIALS!
?>
Newsletter
Join Design Community
Get the latest updates, creative tips, and exclusive resources straight to your inbox. Let’s explore the future of design and innovation together.