Syntax:int IntlChar::getIntPropertyValue ($codepoint, $property)
Parameter:this function takes two parameters as above and described below:
- $codepoint:input parameter $codepoint - it is a character or integer value that is encoded as a UTF-8 string.
- $propertyStores a Unicode character constant. Example: IntlChar::PROPERTY_ * constants.
Returned values: - It returns a numeric value, which is the property value itself or enumerated properties matches the numeric value of an enumerated constant of the corresponding enumeration type of the property value.
- Returns a Boolean value (0/1 or FALSE / TRUE) for Unicode binary properties.
- Returns a bitwise value masks for mask properties.
- It returns 0 if the property is out of bounds, or if the Unicode version has no data at all for the property, or not for that code point.
The programs below illustrate the
IntlChar::getIntPropertyValue() functionin PHP:
Program 1:
// Alphabetical input data
var_dump (IntlChar::getIntPropertyValue (
" A "
,
IntlChar::PROPERTY_ALPHABETIC) === 1);
// Input data is of the type of mirror brackets
var_dump (IntlChar::getIntPropertyValue (
"["
,
IntlChar::PROPERTY_BIDI_MIRRORED) === 1);
// Input data is a space
var_dump (IntlChar::getIntPropertyValue (
""
,
IntlChar::PROPERTY_POSIX_BLANK) === 1);
// The input data has a special character type
var_dump (IntlChar::getIntPropertyValue (
"?"
,
IntlChar::PROPERTY_BLOCK) === IntlChar::BLOCK_CODE_GREEK);
?>
Exit:bool (true ) bool (true) bool (true) bool (false)
Program 2: < ? php
// Alphabetical input data
var_dump (IntlChar::getIntPropertyValue (
"A"
,
IntlChar::PROPERTY_ALPHABETIC) === 1);
// The input data has a special character type
var_dump (IntlChar::getIntPropertyValue (
"|"
,
IntlChar::PROPERTY_BIDI_MIRRORED) === 1);
// The input data has a special character type
var_dump (IntlChar::getIntPropertyValue (
"?"
,
IntlChar::PROPERTY_BLOCK) === IntlChar::BLOCK_CODE_GREEK);
// Input data is of numeric type
var_dump (IntlChar::getIntPropertyValue (
"9"
,
IntlChar::PROPERTY_NUMERIC_TYPE) === 1);
// Math type input
var_dump (IntlChar::getIntPropertyValue (
"="
,
IntlChar::PROPERTY_MATH) === 1);
?>
Exit:bool (true ) bool (false) bool (false) bool (true) bool (true)
Link:https://www.php.net/manual/en/intlchar.getintpropertyvalue.php