Capitalizing The First Letter In Each Word | PHP

PHP's ucwords function can be used to create readable blog post titles by capitalizing the first characters of each word.

Additionally, you can capitalize the first character of names in your app.

Below is an example of how to use the ucwords function.


01: <?php
03: $text = 'here is some text';
04: $formattedString = ucwords($text);
06: echo $formattedString; //Here Is Some Text

Here is another article for you 😊 "Adding a copy button to HighlightJS Code Snippets"