How to convert a string to uppercase in PHP

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.



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


$str = 'Welcome to PHP Tutorials!';
echo strtoupper($str); // Output : WELCOME TO PHP TUTORIALS!

Praveen Kumar

I am a fullstack web developer with a passion for SEO, creating stunning websites, and organic marketing. I am a perfectionist.

Post navigation