The IntlChar::enumCharTypes() function is an inbuilt function in PHP which is used to give a catalog of all the code points with their Unicode general categories. All the cataloging happens very efficiently of all the code points. For enumerating all the assigned code points and building data structures etc, this will be very useful. The callback function is called for each code points of a contiguous range with a given general category and the character type. Adjacent ranges could have different types. The guarantee that the numeric value of the type will be 0 to 31 is guaranteed by the Unicode Standard.
void IntlChar::enumCharTypes( $callback )
Parameters: This function accepts single parameter $callback. For each contiguous range of code points with the same general category, the function will be called. The callback function contains three parameters which are listed below:
- integer $start: It is the starting code point.
- integer $end: It is the ending code point.
- integer $name: The category type (one of the IntlChar::CHAR_CATEGORY_* constants)
Return Values: This function does not return any value.
Below program illustrates the IntlChar::enumCharTypes() function in PHP:
U+0000 through U+0020 are in category 15 U+0020 through U+0021 are in category 12 U+0021 through U+0024 are in category 23 U+0024 through U+0025 are in category 25 U+0025 through U+0028 are in category 23 U+0028 through U+0029 are in category 20 U+0029 through U+002a are in category 21 U+002a through U+002b are in category 23 U+002b through U+002c are in category 24 U+002c through U+002d are in category 23 U+002d through U+002e are in category 19 U+002e through U+0030 are in category 23 U+0030 through U+003a are in category 9 ...
- PHP | IntlChar::chr() Function
- PHP | IntlChar::ord() Function
- PHP | IntlChar::isISOControl() Function
- PHP | IntlChar::isIDPart() Function
- PHP | IntlChar::isIDStart() Function
- PHP | IntlChar::isalpha() Function
- PHP | IntlChar::isULowercase() Function
- PHP | IntlChar getPropertyName() Function
- PHP | IntlChar::forDigit() Function
- PHP | IntlChar::isJavaIDPart() Function
- PHP | IntlChar foldCase() Function
- PHP | IntlChar::totitle() Function
- PHP | IntlChar::isUUppercase() Function
- PHP | IntlChar::isspace() Function
- PHP | IntlChar::isalnum () Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.