ucwords

(PHP3 >= 3.0.3, PHP4 )

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

説明

string ucwords (string str)

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

例 1. ucwords()の例


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

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