The IntlChar digit() function is used to display the decimal digit value of a code point for a given radix.
Syntax
int IntlChar::digit( $val, $radix )
Parameters
val − An integer or character encoded as a UTF-8 string.
radix − The radix value. Default is 10.
Return
The IntlChar digit() function returns the number represented by the character in the given radix.
Example
The following is an example −
<?php
var_dump(IntlChar::digit("2"));
echo "<br>";
var_dump(IntlChar::digit("Z"));
echo "<br>";
var_dump(IntlChar::digit("6", 2));
?>Output
The following is the output −
int(2) bool(false) bool(false)