This article mainly introduces the method of converting the first letter of a string to uppercase in php, involving ucfirst and ucwords in php For tips on using functions, friends who need it can refer to it
The example in this article describes how to convert the first letter of a string to uppercase in PHP. Share it with everyone for your reference. The specific analysis is as follows:
In PHP, you can use the ucfirst function to convert the first letter in a string to uppercase, and the ucwords function can convert the first letter of each word in a string to uppercase
?
3 4
5
6
|
$string = "php string functions are easy to use.";
|
1 2 | Php string functions are easy to use. Php String Functions Are Easy To Use |