strtoupper – PHP String Functions
Syntax :
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.
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.
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.