重複の可能性:
最初の文字を大文字で表示するにはどうすればよいですか?
PHP は、文の最初の単語の最初の文字を大文字にします
文の最初の文字とピリオドの後の文字を大文字にしたい。誰でも方法を提案できますか?
例えば、
//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
次の出力が必要です。
Needs to identify areas of strength and
weakness. Sets goals for self-improvement.