Since: 8.5

final class IntlListFormatter (View source)

Constants

TYPE_AND

TYPE_OR

TYPE_UNITS

WIDTH_WIDE

WIDTH_SHORT

WIDTH_NARROW

Methods

__construct(string $locale, int $type = IntlListFormatter::TYPE_AND, int $width = IntlListFormatter::WIDTH_WIDE)

Creates a new IntlListFormatter instance

string|false
format(array $strings)

Format a list of items

int
getErrorCode()

No description

string
getErrorMessage()

No description

Details

__construct(string $locale, int $type = IntlListFormatter::TYPE_AND, int $width = IntlListFormatter::WIDTH_WIDE)

Creates a new IntlListFormatter instance

Creates a new IntlListFormatter instance for the given locale.

Parameters

string $locale

The locale to use for formatting.

int $type

The list type. One of the IntlListFormatter::TYPE_* constants: IntlListFormatter::TYPE_AND, IntlListFormatter::TYPE_OR, or IntlListFormatter::TYPE_UNITS.

int $width

The list width. One of the IntlListFormatter::WIDTH_* constants: IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT, or IntlListFormatter::WIDTH_NARROW.

string|false format(array $strings)

Format a list of items

Formats a list of items as a locale-appropriate string.

Parameters

array $strings

An array of strings to format as a list.

Return Value

string|false

The formatted list as a string, or false on failure.

int getErrorCode()

No description

Return Value

int

string getErrorMessage()

No description

Return Value

string