How to echo text in capital letters?

I want to know how to use in PHP

+3
source share
2 answers
echo strtoupper('hello');

strtoupper will use the entire string.

If you are only interested in writing the first letter, you can use ucfirst :

echo ucfirst('hello!'); //Hello!

If you want to smooth out the first letter of each word in a string, use ucwords :

echo ucwords('hello world!'); //Hello World!
+14
source

Function strtoupper()is what you are looking for.

+5
source

Source: https://habr.com/ru/post/1711432/


All Articles