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