W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
縮進(jìn)每一行的字符串,默認(rèn)是縮進(jìn)4個(gè)空格。 可選的參數(shù)可以設(shè)置縮進(jìn)的空格數(shù)量。 可選的第二個(gè)參數(shù)設(shè)置縮進(jìn)使用的字符,如用 "\t"
來(lái)代替空格縮進(jìn)。
參數(shù)順序 | 類(lèi)型 | 必選參數(shù) | 默認(rèn)值 | 說(shuō)明 |
---|---|---|---|---|
1 | integer | No | 4 | 設(shè)置縮進(jìn)多少空格 |
2 | string | No | 一個(gè)空格 | 設(shè)置用什么字符來(lái)進(jìn)行縮進(jìn) |
Example 5.12. indent
<?php $smarty->assign('articleTitle', 'NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.' ); ?>
模板:
{$articleTitle} {$articleTitle|indent} {$articleTitle|indent:10} {$articleTitle|indent:1:"\t"}
輸出:
NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25. NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25. NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25. NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.
參見(jiàn) strip
, wordwrap
和 spacify
.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: