IntlListFormatter::format

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

IntlListFormatter::formatFormata uma lista de itens

Descrição

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

Formata uma lista de itens como uma string apropriada para a localidade.

Parâmetros

list
Um array de strings a formatar como uma lista.

Valor Retornado

A lista formatada como uma string ou false em caso de falha.

Exemplos

Exemplo #1 Exemplo de 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
?>

Veja Também

Добавить

Примечания пользователей

Пользователи ещё не добавляли примечания для страницы
To Top