Home >Backend Development >PHP Tutorial >How to capitalize the first letter of a string and the first letter of a word in PHP_PHP Tutorial
This article describes how to capitalize the first letter of a string and the first letter of a word in php. Share it with everyone for your reference. The specific analysis is as follows:
ucfirst can capitalize the first letter of the string, and ucwords can capitalize the first letter of each word in the string.
<?php print ucfirst("hello world"); print ucwords("iam king of the jungle"); ?>
I hope this article will be helpful to everyone’s PHP programming design.