strtoupper – PHP String Functions

Syntax :

strtoupper ( string );

Description :

strtoupper() function will take string as input and converts all letter to uppercase letter, if that character is alphabetic.


Parameter :

  • string – This is a Required parameter. This is a string on which function will be performed.
Note : This function is binary-safe.

Output :

This will return a Uppercased string.


Related articles : ucwords()strtolower()ucfirst()lcfirst().


strtoupper() – PHP Functions Example 1 :
<?php
$strExample = "An EXAMPLE of a strtoupper() function.";
echo strtoupper($strExample);
?>

In above example ,We have a string ‘An EXAMPLE of a strtoupper() function’. Now this function will converts every letter in a string to uppercase. See below is the output of above code.

AN EXAMPLE OF A STRTOUPPER() FUNCTION.

strtoupper() – PHP Functions Example 2 :
<?php
$strExample = "AN Example Of A strtoupper() function WITH 789789.";
echo strtoupper($strExample);
?>

In above example ,We have a string ‘AN Example Of A strtoupper() function WITH 789789.’. Now this function will converts every first letter in a string to uppercase, it will not do anything with numeric numbers. See below is the output of above code.

AN EXAMPLE OF A STRTOUPPER() FUNCTION WITH 789789.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *