I have the word default , and I want the php function to create only the first letter capital. We can do this. Please help me as I am very new to php coding.
default
You can use ucfirst () .
For multibyte strings, see this snippet .
ucfirst capital letters of the first letter in a string.
ucwords are the capital letters of each word in a string.
Hello Gieta, you can simply use the ucwords() php function to make every first letter of the word Upper Cased!
ucwords()
Hope this helps!
I think http://se2.php.net/manual/en/function.ucwords.php is the best feature here :)
This is the code you need:
<?php $string = 'stackoverflow'; $string = ucfirst($string); echo $string; ?>