strtoupper() to change all lower to uppercase characters

Convert ASCII letters to uppercase

strtoupper() converts ASCII a-z to uppercase. Use mb_strtoupper() for non-ASCII Unicode case conversion.

$value = 'Php Tutorial 2026';
echo strtoupper($value); // PHP TUTORIAL 2026

Start with this current pattern. The examples below are retained, corrected where necessary, and expanded for additional variations and output.

$my_str="Hello welcome to plus2net.com";
$my_str=strtoupper($my_str);
echo $my_str;
Above code output will be
HELLO WELCOME TO PLUS2NET.COM
Syntax
$val=strtoupper($input_sting);
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.
Here is an example code.

DEMO

Output :

Example 2: Converting User Input to Uppercase for Case-Insensitive Comparison

When comparing user input, converting both inputs to uppercase ensures case-insensitivity:

$input = "hello";
if (strtoupper($input) === strtoupper("HELLO")) {
    echo "Inputs match!";
}

Example 3: Converting Multibyte Characters to Uppercase

For handling multibyte characters, use *mb_strtoupper()* instead:

$str = "élève";
echo mb_strtoupper($str); // Outputs: ÉLÈVE

String Functions first letter of every word to capitalize by using ucwords Change all alphabetic chars to lowercase Checking all lower case or upper case chars in a string


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer