W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
縮進每一行的字符串,默認是縮進4個空格。 可選的參數可以設置縮進的空格數量。 可選的第二個參數設置縮進使用的字符,如用 "\t"
來代替空格縮進。
參數順序 | 類型 | 必選參數 | 默認值 | 說明 |
---|---|---|---|---|
1 | integer | No | 4 | 設置縮進多少空格 |
2 | string | No | 一個空格 | 設置用什么字符來進行縮進 |
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.
參見 strip
, wordwrap
和 spacify
.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: