PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

IntlChar::getPropertyValueEnum - Get the property value for a given value name | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

IntlChar::getPropertyValueEnum

(PHP 7)

IntlChar::getPropertyValueEnumGet the property value for a given value name

説明

public static int IntlChar::getPropertyValueEnum ( int $property , string $name )

Returns the property value integer for a given value name, as specified in the Unicode database file PropertyValueAliases.txt. Short, long, and any other variants are recognized.

注意:

Some of the names in PropertyValueAliases.txt will only be recognized with IntlChar::PROPERTY_GENERAL_CATEGORY_MASK, not IntlChar::PROPERTY_GENERAL_CATEGORY. These include:

  • "C" / "Other"
  • "L" / "Letter"
  • "LC" / "Cased_Letter"
  • "M" / "Mark"
  • "N" / "Number"
  • "P" / "Punctuation"
  • "S" / "Symbol"
  • "Z" / "Separator"

パラメータ

property

調べたい Unicode プロパティ (定数 IntlChar::PROPERTY_* を参照ください)。

If out of range, or this method doesn't work with the given value, IntlChar::PROPERTY_INVALID_CODE is returned.

name

The value name to be matched. The name is compared using "loose matching" as described in PropertyValueAliases.txt.

返り値

Returns the corresponding value integer, or IntlChar::PROPERTY_INVALID_CODE if the given name does not match any value of the given property, or if the property is invalid.

例1 さまざまなプロパティの例

<?php
var_dump
(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BLOCK'greek') === IntlChar::BLOCK_CODE_GREEK);
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS'RIGHT_TO_LEFT') === IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT);
var_dump(IntlChar::getPropertyValueEnum(IntlChar::PROPERTY_BIDI_CLASS'some made-up string') === IntlChar::PROPERTY_INVALID_CODE);
var_dump(IntlChar::getPropertyValueEnum(123456789'RIGHT_TO_LEFT') === IntlChar::PROPERTY_INVALID_CODE);
?>

上の例の出力は以下となります。

bool(true)
bool(true)
bool(true)
bool(true)

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「IntlChar::getPropertyValueEnum - Get the property value for a given value name」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | IntlChar::getPropertyValueEnum - Get the property value for a given value name」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: