goblindegook/delimiter-align

There is no license information available for the latest version (0.2.0) of this package.

Aligns and rebalances plain text multiline strings around a delimiter.

0.2.0 2015-08-09 17:27 UTC

README

Aligns and rebalances plain text multiline strings around a delimiter.

In short, it turns this:

one: 1
two: 2
three: 3

into this:

one:   1
two:   2
three: 3

Installation

Install using Composer by running the following in your project directory:

$ composer require goblindegook/delimiter-align

Description

string delimiter_align ( string $string [, string $delimiter ] [, array $options ] );

Aligns and rebalances plain text multiline strings around a delimiter.

Parameters

string

Multiline string to align.

delimiter

Boundary string to align around. (Optional, defaults to :.)

options

Alignment options:

Option Description Default
before String prepended to the padded delimiter. (empty)
after String appended to the padded delimiter. ' '
pad Padding character. ' '
right Align the delimiter by placing padding on the left. false

Return Value

Returns the string aligned around the provided delimiter.