Syntax:void IntlChar::enumCharNames ($start, $limit, $callback, $nameChoice = IntlChar::UNICODE_CHAR_NAME)
Parameters:This function takes four parameters as specified and described below:
- start:This parameter contains the first code point in the enumeration range.
- limit:this parameter contains one more point than the last point in the range.
- callback: for each symbol name, the function to be called. This function takes three parameters, which are listed below:
- $codepoint:contains the value of the numeric codepoint.
- $nameChoice:contains nameChoice value.
- $name:contains the name of the character.
- nameChoice:types of names to be listed. It can be any of these five specified constants:
- IntlChar::UNICODE_CHAR_NAME (default constant)
- IntlChar::CHAR_NAME_ALIAS
- IntlChar::CHAR_NAME_CHOICE_COUNT
- IntlChar::EXTENDED_CHAR_NAME
- IntlChar::UNICODE_10_CHAR_NAME
Returned values:this function does not return any value.The program below illustrates the IntlChar::enumCharNames() functionin PHP:Program:
// PHP program for using IntlChar::enumCharNames()
// function
IntlChar::enumCharNames (0x2700, 0x2710,
fu nction
(
$codepoint
,
$nameChoice
,
$name
) {
printf (
"U +% 04x% s"
,
$codepoint
,
$name
);
});
?>
Output: U + 2700 BLACK SAFETY SCISSORS U + 2701 UPPER BLADE SCISSORS U + 2702 BLACK SCISSORS U + 2703 LOWER BLADE SCISSORS U + 2704 WHITE SCISSORS U + 2705 WHITE HEAVY CHECK MARK U + 2706 TELEPHONE LOCATION SIGN U + 2707 TAPE DRIVE U + 2708 AIRPLANE U + 2709 ENVELOPE U + 270a RAISED FIST U + 270b RAISED HAND U + 270c VICTORY HAND U + 270d WRITING HAND U + 270e LOWER RIGHT PENCIL U + 270f PENCIL
Link: https://www.php.net/manual/en/intlchar.enumcharnames.php