How to print all alphabets into upper in php || how to use string to upper function
×


How to print all alphabets into upper in php

0 1029

strtoupper function is used to convert all letters or alphabets into capital or upper case and it is very simple to use. This function is very useful, because you didn't need specially to write all alphabets in uppercase.

Syntax used for this: strtoupper(pass the string here)

Code:

<!DOCTYPE html>
<html>
<body>

<?php
$getvariabe = "I want to print all small letters automatically in capital letters.";
$applyfunction = strtoupper($getvariabe);
echo $applyfunction;

// It will give you the below result.
// I WANT TO PRINT ALL SMALL LETTERS AUTOMATICALLY IN CAPITAL LETTERS.
?>

But remember strtoupper function does not convert special alphabets into lower case.
For example:

<?php
$getvariabe = "Convert r??? Into Capital Alphabet.";
$applyfunction = strtoupper($getvariabe);
echo $applyfunction;
// It will print the below result.
// CONVERT r??? INTO CAPITAL ALPHABET.
?>

</body>
</html>

Beginners Learn PHP Online


Share:


Leave a Reply


Comments
    Waiting for your comments