indent

1.0 1.1 1.2 1.3

Indents every line of a text by the given amount of characters

<?php
indent(string $value, [ int $by = 4, [ string $char = ' ' ]])
  • value: the string to indent
  • by: how many characters should be inserted before each line
  • char: the character(s) to insert

Examples

Example #1

index.tpl
baseline
{indent "foo bar baz
qux and then what was it
again? quux quuux and so on I think"}

The above example will output:

baseline
    foo bar baz
    qux and then what was it
    again? quux quuux and so on I think