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.
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)
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:
int(71) int(9731) NULL NULL
int(71) int(9731) NULL
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.