Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<IntlListFormatter::__constructIntlPartsIterator>
^IntlListFormatterLast updated: Mon, 26 Oct 2026

IntlListFormatter::format

(No version information available, might only be in Git)

IntlListFormatter::format — Format a list of items

Description

public function IntlListFormatter::format(array $list): string|false

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

Parameters

list

An array of strings to format as a list.

Return Values

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

Examples

Example #1 IntlListFormatter::format() example

<?php
$fmt = new IntlListFormatter('en_US', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE);
echo $fmt->format(['one', 'two', 'three']);
// one, two, and three

$fmt = new IntlListFormatter('en_US', IntlListFormatter::TYPE_OR, IntlListFormatter::WIDTH_WIDE);
echo $fmt->format(['one', 'two', 'three']);
// one, two, or three
?>

See Also


<IntlListFormatter::__constructIntlPartsIterator>
^IntlListFormatterLast updated: Mon, 26 Oct 2026