ord
: , , getNumericValue. , - . , .
, , - , Unicode:
function getNumericValue($ch) {
if (ctype_digit($ch))
return ord($ch) - ord('0');
if (ctype_upper($ch))
return ord($ch) - ord('A') + 10;
if (ctype_lower($ch))
return ord($ch) - ord('a') + 10;
return -1;
}