php
Convert string to uppercase in PHP
September 17, 2022
If you need to convert a string to uppercase in PHP, you can use the strtoupper() function. This function takes a string as an argument and returns a string with all uppercase letters.
<?php
echo strtoupper("We are ProgRammers");
// -> WE ARE PROGRAMMERS
?>
Here, we are using strtoupper() function to convert all the characters to uppercase using PHP. The function converts each character of the string to uppercase.
Syntax
strtoupper($str)
More examples:
echo strtoupper("make the WORLD a Beautiful Place");
// -> MAKE THE WORLD A BEAUTIFUL PLACE
echo strtoupper("Hello world");
// -> HELLO WORLD
Was this helpful?
Similar Posts
- Uppercase first character of a String in PHP
- Uppercase first character of each word of a String in PHP
- Convert String date to DATE MONTH-NAME YEAR format php
- Convert String to an Integer in PHP
- Convert characters to lowercase using strtolower() function in PHP
- Convert HTML code to plain text in PHP
- Convert Mysql date to Google sitemap date format PHP