This article mainly introduces php's method of converting string initials to uppercase and involves the use of ucfirst and ucwords functions in php. For more information, see
This article mainly introduces php's method of converting string initials to uppercase and involves the use of ucfirst and ucwords functions in php. For more information, see
This article describes how php converts the initial character of a string to uppercase. Share it with you 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, while the ucwords function can convert the first letter of each word in a string to uppercase.
<? Php $ string = "php string functions are easy to use. "; $ sentence = ucfirst ($ string); $ title = ucwords ($ string); print (" $ sentence \ n "); print (" $ title \ n "); print ("\ n");?>
The output result is as follows:
Php string functions are easy to use. Php String Functions Are Easy To Use
I hope this article will help you with php programming.
,