?
本文檔使用 php中文網(wǎng)手冊(cè) 發(fā)布
Smarty - the compiling PHP template engine | ||
---|---|---|
Prev 來(lái)源:PHP中文社區(qū) | Chapter 5. Variable Modifiers[變量調(diào)節(jié)器] | Next |
Parameter Position | Type | Required | Default | Description |
---|---|---|---|---|
1 | integer | No | 80 | This determines how many columns to wrap to. 指定段落(句子)的寬度 |
2 | string | No | \n | This is the string used to wrap words with. 使用什么字符約束 |
3 | boolean | No | false | This determines whether or not to wrap at a word boundary (false), or at the
exact character (true). 是約束到詞的邊界(假)還是精確到字符(真) |
This wraps a string to a column width, default is 80.
As an optional second parameter, you can specify a string of text to wrap
the text to the next line (default is carriage return \n).
By default, wordwrap will attempt to wrap at a word boundary. If you want
to cut off at the exact character length, pass the optional third parameter
of true.
可以指定段落的寬度(也就是多少個(gè)字符一行,超過(guò)這個(gè)字符數(shù)換行).默認(rèn)80.
第二個(gè)參數(shù)可選,可以指定在約束點(diǎn)使用什么字符(默認(rèn)是換行符\n).
默認(rèn)情況下smarty將截取到詞尾,如果想精確到設(shè)定長(zhǎng)度的字符,請(qǐng)將第三個(gè)參數(shù)設(shè)為ture
Example 5-23. wordwrap
|
Prev 來(lái)源:PHP中文社區(qū) | Home | Next |
upper[大寫(xiě)] | Up | Combining Modifiers[組合使用調(diào)節(jié)器] |