IntlChar::getPropertyValueEnum
(PHP 7)
IntlChar::getPropertyValueEnum — Get the property value for a given value name
Описание
$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
, notIntlChar::PROPERTY_GENERAL_CATEGORY
. These include:
- "C" / "Other"
- "L" / "Letter"
- "LC" / "Cased_Letter"
- "M" / "Mark"
- "N" / "Number"
- "P" / "Punctuation"
- "S" / "Symbol"
- "Z" / "Separator"
Список параметров
-
property
-
The Unicode property to lookup (see the IntlChar::PROPERTY_* constants).
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 Testing different properties
<?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)
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Поддержка языков и кодировок
- Internationalization Functions
- IntlChar::charAge
- IntlChar::charDigitValue
- IntlChar::charDirection
- IntlChar::charFromName
- IntlChar::charMirror
- IntlChar::charName
- IntlChar::charType
- IntlChar::chr
- IntlChar::digit
- IntlChar::enumCharNames
- IntlChar::enumCharTypes
- IntlChar::foldCase
- IntlChar::forDigit
- IntlChar::getBidiPairedBracket
- IntlChar::getBlockCode
- IntlChar::getCombiningClass
- IntlChar::getFC_NFKC_Closure
- IntlChar::getIntPropertyMaxValue
- IntlChar::getIntPropertyMinValue
- IntlChar::getIntPropertyValue
- IntlChar::getNumericValue
- IntlChar::getPropertyEnum
- IntlChar::getPropertyName
- IntlChar::getPropertyValueEnum
- IntlChar::getPropertyValueName
- IntlChar::getUnicodeVersion
- IntlChar::hasBinaryProperty
- IntlChar::isalnum
- IntlChar::isalpha
- IntlChar::isbase
- IntlChar::isblank
- IntlChar::iscntrl
- IntlChar::isdefined
- IntlChar::isdigit
- IntlChar::isgraph
- IntlChar::isIDIgnorable
- IntlChar::isIDPart
- IntlChar::isIDStart
- IntlChar::isISOControl
- IntlChar::isJavaIDPart
- IntlChar::isJavaIDStart
- IntlChar::isJavaSpaceChar
- IntlChar::islower
- IntlChar::isMirrored
- IntlChar::isprint
- IntlChar::ispunct
- IntlChar::isspace
- IntlChar::istitle
- IntlChar::isUAlphabetic
- IntlChar::isULowercase
- IntlChar::isupper
- IntlChar::isUUppercase
- IntlChar::isUWhiteSpace
- IntlChar::isWhitespace
- IntlChar::isxdigit
- IntlChar::ord
- IntlChar::tolower
- IntlChar::totitle
- IntlChar::toupper
Коментарии
404 Not Found