PHP 8.6.0 Alpha 2 available for testing

IntlListFormatter::format

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

IntlListFormatter::formatFormate une liste d'éléments

Description

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

Formate une liste d'éléments sous la forme d'une chaîne de caractères adaptée aux paramètres régionaux.

Liste de paramètres

list
Un tableau de chaînes de caractères à formater sous la forme d'une liste.

Valeurs de retour

La liste formatée sous la forme d'une chaîne de caractères, ou false en cas d'échec.

Exemples

Exemple #1 Exemple avec IntlListFormatter::format()

<?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
?>

Voir aussi

adicionar nota

Notas de Usuários

Não há notas de usuários para esta página.
To Top