« IntlDatePatternGenerator::getBestPattern
IntlListFormatter::__construct »

IntlListFormatter クラス

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

はじめに

ロケール固有のルールに従って、項目のリストのフォーマット、順序付け、句読点の付与を行います。 ICU 67 以降が必要です。

クラス概要

class IntlListFormatter {
/* 定数 */
public const int TYPE_AND;
public const int TYPE_OR;
public const int TYPE_UNITS;
public const int WIDTH_WIDE;
public const int WIDTH_SHORT;
public const int WIDTH_NARROW;
/* メソッド */
public function format(array $list): string|false
}

定義済み定数

IntlListFormatter::TYPE_AND

「and」にあたる接続詞を使ってリストをフォーマットします (例: "A, B, and C")。

IntlListFormatter::TYPE_OR

「or」にあたる接続詞を使ってリストをフォーマットします (例: "A, B, or C")。

IntlListFormatter::TYPE_UNITS

単位のリストをフォーマットします (例: "3 ft, 7 in")。

IntlListFormatter::WIDTH_WIDE

最も幅の広い (最も冗長な) リスト形式を使用します。通常、接続詞は省略されずに完全な形で表記されます。

IntlListFormatter::WIDTH_SHORT

短いリスト形式を使用します。通常は省略形が使われます。

IntlListFormatter::WIDTH_NARROW

最も幅の狭いリスト形式を使用します。句読点は最小限になります。

変更履歴

バージョン 説明
8.5.0 このクラスが追加されました。

目次

関連キーワード:
IntlListFormatter   フォーマット   construct   接続詞   項目   句読点   定数   format   通常   省略   IntlDatePatternGenerator   getBestPattern   intl   information   available   ロケール   固有   ルール   順序   付与   概要   locale   type   width   list
関連する関数・ページ:
intllistformatter.construct   intllistformatter.format   migration85.new-features   intldatepatterngenerator.getbestpattern   imagick.setimageformat   function.fscanf