IntlChar::getPropertyEnum
(PHP 7, PHP 8)
IntlChar::getPropertyEnum — Get the property constant value for a given property name
Parameters
alias
-
The property name to be matched. The name is compared using "loose matching" as described in PropertyAliases.txt.
Examples
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);
?>
The above example will output:
bool(true)
bool(true)
bool(true)
bool(true)