ucwords

ucwords -- 文字列の各単語の最初の文字を大文字にする

説明

string ucwords(string str);

文字がアルファベットの場合、str の各単語の 最初の文字を大文字にします。

例 1. ucwords()の例

  1 
  2 $text = "mary had a little lamb and she loved it so.";
  3 $text = ucwords($text); // $textは「Mary Had A Little Lamb And She Loved It So」になります。
  4        

strtoupper(), strtolower(),ucfirst() も参照下さい。