capitalize[首字大写]

capitalize(将变量里的所有单词首字大写)

test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Police begin campaign to rundown jaywalkers.');
$smarty->display('test.html');

test.html:
{$articleTitle}
{$articleTitle|capitalize}

输出:
Police begin campaign to rundown jaywalkers.
Police Begin Campaign To Rundown Jaywalkers.


继续学习
||
<?php echo "capitalize(将变量里的所有单词首字大写)";
提交重置代码
  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~