Quantcast
Channel: Different PHP Blog » PHP
Viewing all articles
Browse latest Browse all 3

PHP capitalize first letter

0
0

To capitalize only first letter in word use PHP function ucfirst():

    echo ucfirst('anaCONda').'<br>';
    echo ucfirst('AnaCONda');

This will output:
AnaCONda
AnaCONda

To capitalize all word first letters in a sentence, use ucwords():

   echo ucwords('thE trutH is outside');

This will output:
ThE TrutH Is Outside


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images