How To Convert Lowercase To Uppercase In PHP?

What we are going to see through this article is How To Convert Lowercase To Uppercase In PHP?. We can use strtoupper() function in PHP to change all the alphabetic characters to uppercase. This simple function takes one string as input and changes the characters present inside to uppercase.

string strtoupper ( $string )
How To Convert Lowercase To Uppercase In PHP

Convert Lowercase to Uppercase in PHP

This is the first example program code to convert lowercase to uppercase in PHP here.

<?php

// original string
$str = "Welcome to our website Codingdeekshi";

// string converted to upper case
$resStr = strtoupper($str);

print_r($resStr);

?>

Output

This is a sample output for your reference shown below:

WELCOME TO OUR WEBSITE CODINGDEEKSHI

Convert Lowercase to Uppercase in PHP

This is another example program code to perform a task below:

<?php

// original string
$str = "This is my car";

// string to upper case
$resStr = strtoupper($str);

print_r($resStr);

?>

Read Also: Convert Array To String In PHP?

Output

This is an example output for your reference shown below:

THIS IS MY CAR

Final Words

What we learned through this article is How To Convert Lowercase To Uppercase In PHP?. Also if you have any doubts please leave a comment via the comment box. And we ask that you benefit everyone who shared this article with your friends.

Leave a Comment