upper

This is used to uppercase a variable.

此函式會將變數裡的字元變成大寫。

Example 5-21. upper

<?php

$smarty
= new Smarty;
$smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
$smarty->display('index.tpl');

?>

where index.tpl is:

其中 index.tpl 的內容為:

{$articleTitle}
{$articleTitle|upper}

This will output:

輸出結果為:

If Strike isn't Settled Quickly it may Last a While.
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.