PHP | IntlChar getBlockCode() Function Last Updated : 04 Nov, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The IntlChar::getBlockCode() function is an inbuilt function in PHP which is used to get the Unicode allocation block containing the code point. This function returns the Unicode allocation block that contains the character. Syntax: int IntlChar::getBlockCode ( $codepoint ) Parameters: This function accepts a single parameter $codepoint which is mandatory. The $codepoint value is an integer values or character, which is encoded as a UTF-8 string. Return Value: This function returns the block value for $codepoint. Some block value of codepoint are listed below: IntlChar::BLOCK_CODE_BASIC_LATINIntlChar::BLOCK_CODE_GREEKIntlChar::BLOCK_CODE_MISCELLANEOUS_SYMBOLS Below programs illustrate the IntlChar::getBlockCode() function in PHP: Program 1: PHP <?php // PHP function to illustrate // the use of IntlChar::getBlockCode() // Input data is character type var_dump(IntlChar::getBlockCode("G") === IntlChar::BLOCK_CODE_BASIC_LATIN); // Input data is string type var_dump(IntlChar::getBlockCode("ABC") === IntlChar::BLOCK_CODE_BASIC_LATIN); // Input data is character type var_dump(IntlChar::getBlockCode("*") === IntlChar::BLOCK_CODE_GREEK); // Input data is unicode character type var_dump(IntlChar::getBlockCode("\u{2603}") === IntlChar::BLOCK_CODE_MISCELLANEOUS_SYMBOLS); // Input data is character type var_dump(IntlChar::getBlockCode("@") === IntlChar::BLOCK_CODE_GREEK); ?> Output: bool(true) bool(false) bool(false) bool(true) bool(false) Program 2: PHP <?php // PHP code to illustrate IntlChar::getBlockCode() // Declare an array $arr $arr = array("G", "GeeksforGeeks", "^", "1001", "6", "\n"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data var_dump(IntlChar::getBlockCode($val)); } ?> Output: int(1) NULL int(1) NULL int(1) int(1) Related Articles: PHP | IntlChar::iscntrl() FunctionPHP | IntlChar::totitle() FunctionPHP | IntlChar charType() Function Reference: http://php.net/manual/en/intlchar.getblockcode.php Comment More infoAdvertise with us Next Article PHP | IntlCalendar getErrorCode() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP PHP-function PHP-Intl +1 More Practice Tags : Misc Similar Reads PHP | IntlCalendar getErrorCode() Function The IntlCalendar::getErrorCode() function is an inbuilt function in PHP which returns the numeric ICU error code for the last call on this object or the IntlCalendar given for the calendar parameter. This function can indicate a warning message (negative error code) or no error. Syntax: Object orien 1 min read PHP | IntlChar getUnicodeVersion() Function The IntlChar::getUnicodeVersion() function is an inbuilt function in PHP which is used to get the Unicode version. The Unicode standard version information is filled into an array. For example, Unicode version 2.2.1 is represented as an array with the values [2, 2, 1, 0]. Syntax: array IntlChar::get 1 min read PHP | IntlChar getNumericValue() Function The IntlChar::getNumericValue() function is an inbuilt function in PHP which is used to get the numeric value for a Unicode code point as defined in the Unicode Character Database. Syntax: float IntlChar::getNumericValue( $codepoint ) Parameters: This function accepts a single parameter $codepoint w 2 min read PHP | IntlChar getBidiPairedBracket() Function The IntlChar::getBidiPairedBracket() function is an inbuilt function in PHP which is used to get the paired bracket character for a code point. This function mapped with paired bracket. If the character has no pair bracket then it returns the character itself. Syntax: IntlChar::getBidiPairedBracket 2 min read 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 2 min read PHP | IntlChar getPropertyName() Function The IntlChar::getPropertyName() function is an inbuilt function in PHP which is used to get the Unicode name for a given property which is given in the Unicode database file PropertyAliases.txt. This function maps the property IntlChar::PROPERTY_GENERAL_CATEGORY_MASK to the synthetic names "gcm" / " 2 min read Like