wrapBlock.php
Table of Contents
Functions
- wrapBlock() : string
- Wraps a block of lines with a header and footer line.
Functions
wrapBlock()
Wraps a block of lines with a header and footer line.
wrapBlock(array<string|int, mixed>|string $lines, string $before, string $after[, string|int $indent = '' ][, string $separator = PHP_EOL ][, bool $keepEmptyLines = true ]) : string
Parameters
- $lines : array<string|int, mixed>|string
-
Array or string of lines to wrap.
- $before : string
-
Line inserted before the block.
- $after : string
-
Line inserted after the block.
- $indent : string|int = ''
-
Indentation for the inner block (default: '').
- $separator : string = PHP_EOL
-
Line separator (defaults to PHP_EOL).
- $keepEmptyLines : bool = true
-
Whether to preserve empty lines (default: true).
Tags
Return values
string —Final wrapped block.