国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

Smarty:truncate

2018-10-12 15:52 更新

truncate

截取字符串到指定長度,默認長度是80. 第二個參數(shù)可選,指定了截取后代替顯示的字符。 截取后的字符長度是截取規(guī)定的長度加上第二個參數(shù)的字符長度。 默認truncate會嘗試按單詞進行截取。 如果你希望按字符截?。▎卧~可能會被截斷),需要設(shè)置第三個參數(shù)TRUE。

參數(shù)順序類型必選參數(shù)默認值說明
1integerNo80截取的長度
2stringNo...截取后替代顯示的字符,該字符長度會被計算到截取長度內(nèi)。
3booleanNoFALSE是否按單詞截取FALSE,或是按字符截取TRUE。
4booleanNoFALSE當(dāng)字符截取的長度剛好等于字符本身長度時,是否截取。FALSE也會截取。 TRUE是不會截取。 注意如果設(shè)置為TRUE,單詞的邊界會被忽略。

Example 5.21. truncate

<?php
$smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
?>

模板:

{$articleTitle}
{$articleTitle|truncate}
{$articleTitle|truncate:30}
{$articleTitle|truncate:30:""}
{$articleTitle|truncate:30:"---"}
{$articleTitle|truncate:30:"":true}
{$articleTitle|truncate:30:"...":true}
{$articleTitle|truncate:30:'..':true:true}

輸出:

Two Sisters Reunite after Eighteen Years at Checkout Counter.
Two Sisters Reunite after Eighteen Years at Checkout Counter.
Two Sisters Reunite after...
Two Sisters Reunite after
Two Sisters Reunite after---
Two Sisters Reunite after Eigh
Two Sisters Reunite after E...
Two Sisters Re..ckout Counter.

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號