update : 2015.11.03
php.shukuma.com

검색:
 
 
Get the property constant value for a given property name

IntlChar::getPropertyEnum

(PHP 7)

IntlChar::getPropertyEnumGet the property constant value for a given property name

설명

public static int IntlChar::getPropertyEnum ( string $alias )

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

In addition, this function maps the synthetic names "gcm" / "General_Category_Mask" to the property IntlChar::PROPERTY_GENERAL_CATEGORY_MASK. These names are not in PropertyAliases.txt.

This function compliments IntlChar::getPropertyName().

인수

alias

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

반환값

Returns an IntlChar::PROPERTY_ constant value, or IntlChar::PROPERTY_INVALID_CODE if the given name does not match any property.

예제

Example #1 Testing different properties

<?php
var_dump
(IntlChar::getPropertyEnum('Bidi_Class') === IntlChar::PROPERTY_BIDI_CLASS);
var_dump(IntlChar::getPropertyEnum('script') === IntlChar::PROPERTY_SCRIPT);
var_dump(IntlChar::getPropertyEnum('IDEOGRAPHIC') === IntlChar::PROPERTY_IDEOGRAPHIC);
var_dump(IntlChar::getPropertyEnum('Some made-up string') === IntlChar::PROPERTY_INVALID_CODE);
?>

위 예제의 출력:

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

참고