PHP | IntlChar charFromName() Function Last Updated : 27 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The IntlChar::charFromName() function is an inbuilt function in PHP which is used to find Unicode character by name and returns the code point value. If Unicode character name does not match to a code point, then it returns NULL. Syntax: int IntlChar::charFromName( $characterName, $nameChoice = IntlChar::UNICODE_CHAR_NAME ) Parameters: This function accepts two parameters as mentioned above and described below: $characterName: This parameter is used to hold the full Unicode character name. $nameChoice: It is used to hold the names for lookup. The list of $nameChoice are given below: IntlChar::UNICODE_CHAR_NAME (default) IntlChar::UNICODE_10_CHAR_NAME IntlChar::EXTENDED_CHAR_NAME IntlChar::CHAR_NAME_ALIAS IntlChar::CHAR_NAME_CHOICE_COUNT Return Value: This function returns the Unicode value of the code point on success or NULL if no code point exists. Below programs illustrate the IntlChar::charFromName() function in PHP: Example 1: php <?php // PHP code to illustrate // IntlChar::charFromName ()function // Input symbol of codepoint value // with constraint UNICODE_CHAR_NAME var_dump(IntlChar::charFromName("LATIN CAPITAL LETTER G")); var_dump(IntlChar::charFromName("SNOWMAN")); var_dump(IntlChar::charFromName("GEEKSFORGEEKS")); var_dump(IntlChar::charFromName("^", IntlChar::CHAR_NAME_ALIAS )); ?> Output: int(71) int(9731) NULL NULL Example 2: php <?php // PHP code to illustrate // IntlChar::charFromName() function // Declare an array $arr with constraint // UNICODE_CHAR_NAME $arr = array( "LATIN CAPITAL LETTER G", "SNOWMAN", "GEEKSFORGEEKS" ); // Loop run for every array element foreach ($arr as $val) { // Check each element as code point data var_dump(IntlChar::charFromName($val)); } ?> Output: int(71) int(9731) NULL Reference: http://php.net/manual/en/intlchar.charfromname.php Comment More infoAdvertise with us Next Article PHP | IntlChar charFromName() Function V vijay_raj Follow Improve Article Tags : PHP Web Technologies PHP-Intl Similar Reads PHP IntlChar::charName() Function PHP IntlChar::charName() function is an inbuilt function in PHP used to retrieve the name of a Unicode character. Syntax: string IntlChar::charName( $codepoint [, $nameChoice = IntlChar::UNICODE_CHAR_NAME] ) Parameters: This function accepts two parameters as mentioned above and described below: $co 2 min read PHP | IntlChar::charAge() Function The IntlChar::charAge() function is an inbuilt function in PHP which is used to calculate the age of code point. Where the age is Unicode version when the code point was first designated or assigned a character. This can be useful to avoid emitting code points to receiving processes that do not acce 2 min read PHP | IntlChar enumCharNames() Function The IntlChar::enumCharNames() function is an inbuilt function in PHP which is used to give a catalog of all the assigned Unicode characters that are available within a range. The list will have the Unicode characters that are available between the start code points (start inclusive) and the limit co 2 min read PHP | IntlChar::chr() Function The IntlChar::chr() function is an inbuilt function in PHP which is used to check whether the given input character is Unicode code point value or not. It returns Unicode character by code point value.Syntax: string IntlChar::chr( $codepoint ) Parameters: This function accepts a single parameter $co 2 min read PHP | IntlChar::charMirror() Function The IntlChar::charMirror() function is an inbuilt function in PHP which is used to find the "mirror-image" character from the given input code point character, which maps the specified character. Syntax: mixed IntlChar::charMirror( $codepoint ) Parameters: This function accepts a single parameter $c 2 min read PHP | IntlChar charDirection() Function The IntlChar::charDirection() function is an inbuilt function in PHP which is used to get the bidirectional category value for a code point. It returns the bidirectional category value for the code point, which is used in the Unicode bidirectional algorithm. Syntax: int IntlChar::charDirection ( $co 2 min read PHP | IntlChar foldCase() Function The IntlChar::foldCase() function is an inbuilt function in PHP which is used to perform case folding on a code point. Case folding means the given character is mapped to its equivalent lowercase characters.Syntax: mixed IntlChar::foldCase( $codepoint, $options = IntlChar::FOLD_CASE_DEFAULT ) Parame 1 min read PHP | IntlChar::charDigitValue() Function The IntlChar::charDigitValue() function is an inbuilt function in PHP which is used to return the decimal digit value from a decimal digit character. Where the general category decimal digit numbers and "Nd" is Numeric_Type of Decimal.Syntax:Â Â int IntlChar::charDigitValue( $codepoint ) Parameters: 2 min read PHP | IntlChar enumCharTypes() Function 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 struct 2 min read PHP | IntlChar::forDigit() Function The IntlChar::forDigit() function is an inbuilt function in PHP which is used to determines the character representation for a specific digit in the specified radix. Syntax: int IntlChar::forDigit( $digit, $radix ) Parameters: This function accepts two parameters as mentioned above and described bel 2 min read Like