textformat

1.0 1.1 1.2 1.3

Formats a string to the given format, you can wrap lines at a certain length and indent them

<?php
textformat([ int $wrap = 80, [ string $wrap_char = "\r\n", [ string $wrap_cut = false, [ int $indent = 0, [ string $indent_char = " ", [ int $indent_first = 0, [ string $style = "", [ string $assign = "" ]]]]]]]]) 

Examples

Example #1

index.tpl
{textformat 10}here is some text that should wrap{/textformat}
 
{textformat 10 wrap_cut=true}and this one should cut words that go beyoooooooond 10 chars{/textformat}

The above example will output:

here is
some text
that
should
wrap

and this
one should
cut words
that go
beyooooooo
ond 10
chars