The IntlChar::charDigitValue() function checks if the entered value is a decimal digit value or not.
Syntax
int IntlChar::charDigitValue(val)
Parameters
val − A character or integer value encoded as a UTF-8 string.
Return
The IntlChar::charDigitValue() function returns TRUE if the entered value is a decimal digit.
Example
The following is an example −
<?php
var_dump(IntlChar::charDigitValue("989"));
echo "<br>";
var_dump(IntlChar::charDigitValue("1"));
echo "<br>";
var_dump(IntlChar::charDigitValue("Humpty"));
echo "<br>";
var_dump(IntlChar::charDigitValue("u{0774}"));
?>Output
The following is the output −
NULL int(1) NULL NULL