PHP | IntlChar::charDigitValue() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report 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: This function accepts a single parameter $codepoint which is mandatory. The input parameter is a character or integer value, which is encoded as a UTF-8 string.Return Value: If $codepoint is decimal digit value then returns True otherwise return -1. Below programs illustrate the IntlChar::charDigitValue() Function in PHP.Program 1: php <?php // PHP code to illustrate IntlChar::charDigitValue // function //Input int codepoint value var_dump(IntlChar::charDigitValue("\u{2025}")); echo "<br>"; //Input character codepoint value var_dump(IntlChar::charDigitValue("2345")); echo "<br>"; //Input int codepoint value var_dump(IntlChar::charDigitValue("\u{0774}")); echo "<br>"; //Input int codepoint value var_dump(IntlChar::charDigitValue("2")); echo "<br>"; //Input character codepoint value var_dump(IntlChar::charDigitValue("Geeks")); echo "<br>"; //Input character codepoint value var_dump(IntlChar::charDigitValue("\u{0E66}")); echo "<br>"; //Input Empty codepoint value var_dump(IntlChar::charDigitValue(" ")); ?> Output: int(-1) NULL int(-1) int(2) NULL int(-1) int(-1) Program 2: php <?php // PHP code to illustrate // IntlChar::charDigitValue() function // Declare an array $arr $arr = array("^", "2345", "6", "\n"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data var_dump(IntlChar::charDigitValue($val)); echo "<br>"; } ?> Output: int(-1) NULL int(6) int(-1) Related Articles: IntlChar::isalpha() FunctionIntlChar::isbase() FunctionIntlChar::isblank() FunctionIntlChar::iscntrl() Function Reference: https://www.php.net/manual/en/intlchar.chardigitvalue.php Comment More infoAdvertise with us Next Article PHP | IntlChar::charAge() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads PHP | IntlChar digit() function The IntlChar::digit() function is an inbuilt function in PHP which is used to get the decimal digit value of a code point for a given radix. This function returns the decimal digit value of the code point in the specified radix. Syntax: int IntlChar::digit( $codepoint, $radix ) Parameters: This func 2 min read PHP | IntlChar digit() function The IntlChar::digit() function is an inbuilt function in PHP which is used to get the decimal digit value of a code point for a given radix. This function returns the decimal digit value of the code point in the specified radix. Syntax: int IntlChar::digit( $codepoint, $radix ) Parameters: This func 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::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::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::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 Like