Possible Duplicate:
How do I display the first letter as uppercase?
PHP capitalize first letter of first word in a sentence
I want to uppercase the first letter in a sentence and after a period. Can anyone suggest how to do?
For example,
//I have the following in a language class.
"%s needs to identify areas of strength and
weakness. %s sets goals for self-improvement.";
// in a view
$contone=$this->lang->line($colstr);// e.g get the above string.
//$conttwo=substr($contone, 3);//skip "%s " but this doesnot work when there
//are more than one %s
$conttwo=str_replace("%s ", "", $contone);// replace %s to none
$contthree = ucfirst($conttwo); // this only uppercase the first one
I want the following output.
Needs to identify areas of strength and
weakness. Sets goals for self-improvement.
Try below.
It will run the function to capitalize every letter AFTER a full-stop (period) in a string having multiple sentences.
Please do required changes.