php method to convert a string to uppercase: You can use the built-in function strtoupper() to convert. The strtoupper() function converts the specified string to uppercase and returns the string converted to uppercase.
Use function:
(Learning video recommendation: php video tutorial)
strtoupper( ) function converts a string to uppercase and returns the string converted to uppercase.
Grammar:
strtoupper(string)
(Related recommendations: php training)
Code implementation:
<?php $string = "Learn PHP string functions at phpcn"; $lower = strtolower($string); $upper = strtoupper($string); print("$lower\n"); print("$upper\n"); print("\n"); ?>
Output results:
learn php string functions at phpcn LEARN PHP STRING FUNCTIONS AT PHPCN
The above is the detailed content of How to convert string to uppercase in php. For more information, please follow other related articles on the PHP Chinese website!