PHP | IntlChar getPropertyEnum() Function
The IntlChar::getPropertyEnum() function is an inbuilt function in PHP which is used to get the property constant value for a given property name. The property name is going to be specified in PropertyAliases.txt, which is a Unicode Database file. All types of variants are recognized in this, be it long, short and many others. Additionally, the synthetic names “General_Category_Mask” (abbreviated as “gcm”), is mapped by the function to the IntlChar:: PROPERTY_GENERAL_CATEGORY_MASK property. Also, note that these names that are mentioned here are not going to be present in PropertyAliases.txt. This function gets complimented by IntlChar::getPropertyName() function and vice-versa.
int IntlChar::getPropertyEnum( $alias )
Parameters: This function accepts a single parameter alias whose name of the property that is to be matched. Comparisons for the name are made using the “loose matching”. These are all described in the PropertyAliases.txt.
Return Values: If it is a constant value, it will return an IntlChar::PROPERTY_ value. Otherwise, if the name that is given there, is no matching with any property at all, then IntlChar:: PROPERTY_INVALID_CODE is going to be returned.
Below program illustrates the IntlChar::getPropertyEnum() function in PHP:
bool(false) bool(true) bool(false) bool(true) bool(false)