Today, We want to share with you php first character uppercase.In this post we will show you php uppercase first letter of each word, hear for php capitalize all letters we will give you demo and example for implement.In this post, we will learn about How To Capitalize The First Letter Of A String In JavaScript with an example.
How to Convert the First Letter of a String to Uppercase in PHP?
Related functions:
- lcfirst() – converts the first character of a string to lowercase
- ucwords() – converts the first character of each word in a string to uppercase
- strtoupper() – converts a string to uppercase
- strtolower() – converts a string to lowercase
syntax of the ucfirst()
ucfirst(string)
PHP ucfirst() Function
Example 1: index.php
Results
Welcome to Pakainfo.com
php uppercase first letter of each word
PHP – Capitalise first character of each word expect certain words
Example 2:
echo str_replace(['Pakainfo', 'Infinity'], ['pAkainfo', 'iNfinity'], ucwords(strtolower($string)));
php capitalize all letters
Example 3: PHP strtoupper() Function
Results
TAMIL ROCKERS IS A TORRENT WEBSITE WHICH FACILITATES THE ILLEGAL DISTRIBUTION OF COPYRIGHTED MATERIAL, INCLUDING TELEVISION SHOWS, MOVIES, MUSIC AND VIDEOS.
I hope you get an idea about php get first letter of each word.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.