Source for file textformat.php
Documentation is available at textformat.php
* Formats a string to the given format, you can wrap lines at a certain
* * wrap : maximum line length
* * wrap_char : the character(s) to use to break the line
* * wrap_cut : if true, the words that are longer than $wrap are cut instead of overflowing
* * indent : amount of $indent_char to insert before every line
* * indent_char : character(s) to insert before every line
* * indent_first : amount of additional $indent_char to insert before the first line of each paragraphs
* * style : some predefined formatting styles that set up every required variables, can be "email" or "html"
* * assign : if set, the formatted text is assigned to that variable instead of being output
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
public function init($wrap=
80, $wrap_char=
"\r\n", $wrap_cut=
false, $indent=
0, $indent_char=
" ", $indent_first=
0, $style=
"", $assign=
"")
if ($indent_char ===
'tab') {
$indent_char =
$indent_char ==
"\t" ?
' ':
' ';
$this->wrap = (int)
$wrap;
$this->indent = (int)
$indent;
$this->indChar = (string)
$indent_char;
$this->assign = (string)
$assign;
while (list
($i,) =
each($pgs)) {
// removes line breaks and extensive white space
// wordwraps + indents lines
Documentation generated on Sat, 18 Jul 2009 21:05:23 +0200 by phpDocumentor 1.4.0