PHP | IntlChar charFromName() Function Last Updated : 11 Jul, 2025 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: https://www.php.net/manual/en/intlchar.charfromname.php Comment V vijay_raj Follow 0 Improve V vijay_raj Follow 0 Improve Article Tags : Web Technologies PHP PHP-Intl Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like