ucwords
(PHP3 >= 3.0.3 , PHP4)
ucwords --- 將字串中各個單字的第一個字元大寫
語法 :
string ucwords(string str)說明 :
如果參數 str中的各個單字的第一個字元是字母時,則將它轉成大寫的。
Example :
<?php
$text = "mary had a little lamb and she loved it so.";
$text = ucwords($text); // $text is now: Mary Had A Little // Lamb And She Loved It So.
?>
參考 : strtoupper( ) strtolower( ) ucfirst( )