PHP String strtoupper() function4 Sept 2024 | 2 min read The strtoupper() is one of the most popular functions of PHP, which is widely used to convert the string into uppercase. It takes a string as a parameter and converts all lowercase English character of that string to uppercase. Other characters such as numbers and special characters of the string remain the same. PHP 4+ versions support this function. Note: The strtoupper () is a binary-safe function.There are some other functions in PHP which are similar to the strtoupper() function: Related functions
SyntaxThe syntax for the strtoupper() function is given below, which takes only one string parameter. Parameters$string (required): This is a mandatory parameter of this function which specifies a string to convert into uppercase. In simple words - it is a string which is converted into uppercase. Return ValueIt returns converted uppercase string. ExamplesThe strtoupper() is a widely used function of PHP. Below some examples are given. With the help of these examples, we can understand the working of this function practically Example 1 Output: WELCOME TO JAVATPOINT Example 2 Output: String before conversion: hie! I'm Gunjan Garg. String after conversion: HIE! I'M GUNJAN GARG. Example 3 In this example, we will see that special characters remain the same after applying strtoupper() function on the string. It only converts alphabet characters, whereas there is no change in special symbols. Output: String before conversion: !, @, %, $, and # are the special symbols. String after conversion: !, @, %, $, AND # ARE THE SPECIAL SYMBOLS. Next TopicPHP String Functions |
PHP Function The function is predefined function of PHP. It is used to find the length of string or returns the length of a string including all the whitespaces and special character. Syntax: strlen(string); Parameter Description Required/Optional String Specify the string to check. Required. Example 1 <?php $str = 'Javatpoint'; echo "Your String is:".$str; echo "<br>"; echo "By using...
1 min read
PHP String Function The is predefined PHP function. It is used to return parses input from a string according to a format. If we will pass two parameters in the function, the data will be returned as an array. Related Function: print(): It is used for output...
1 min read
PHP string Function The is predefine function of PHP. It is used to repeat a string a specified number times. It returns input repeated multiple times. Syntax: tr_repeat(string,repeat); Parameter Description Required/Optional String Specify the string to repeat. Required repeat Specify the number of times for repeated. required Example 1 <?php echo "Before using '' function: ('.',13)"; echo "<br>"; echo "After using...
1 min read
PHP String Function The function is an in-built function of PHP, which is used to display the array values as a formatted string. It works similar to the sprintf() function, but it accepts an array of arguments rather a variable number of arguments. PHP 4.1.0...
2 min read
PHP Function The function is predefined function of PHP. It is used to reverse a string. It is one of the most basic string operations which are used by programmers and developers. Syntax: string strrev ( string $string ); Parameter Description Required/Optional String Specify the string to reverse Required Example 1 <?php $var1="Hello PHP"; ...
1 min read
PHP string Function The is predefined function of PHP. It is used to convert a string to an array. If the split length is specified, then array will be broken down into chunks with length. It will return FALSE if the split length is less than...
1 min read
PHP String Function The substr_replace is an in-built function of PHP, which replaces a part of the string with another text within a string. PHP 4+ versions support this function. The index in the original string is passed as a parameter to which the replacement is...
3 min read
PHP string md5_file() Function PHP string md5_file() function is in-built important function. It is used to calculate the MD5 hash of a file. It uses the RSA Data Security. It returns the md5 hash on success, or FALSE on failure. Syntax: md5_file(file,raw); Parameter Description Required/Optional File Specify the file to be calculated. Required Raw Specify the Boolean...
1 min read
PHP String Function The function is an in-built function of PHP, which converts pre-defined HTML entities to characters. It is opposite to the htmlspecialchars() function. HTML entities decoded back to the character will be like- &amp; converts as & (ampersand) &quot; converts as " (double-quote) &#039; converts as...
3 min read
PHP String function The is an in-built function of PHP which writes a formatted string to a variable. It returns a formatted string. PHP 4 and above versions support function. The function is similar to the printf() function, but the only difference between both...
5 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India