PHP ucwords函数单词首字母大写
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.
?>