Requests_IDNAEncoder::digit_to_char()
最后更新于:2021-11-26 03:15:19
Requests_IDNAEncoder::digit_to_char( int$digit)Convert a digit to its respective character
参数
- $digit
-
(int) (Required) Digit in the range 0-35
响应
(string) Single character corresponding to digit
源文件
文件: gc-includes/Requests/IDNAEncoder.php
protected static function digit_to_char($digit) {
// @codeCoverageIgnoreStart
// As far as I know, this never happens, but still good to be sure.
if ($digit < 0 || $digit > 35) {
throw new Requests_Exception(sprintf('Invalid digit %d', $digit), 'idna.invalid_digit', $digit);
}
// @codeCoverageIgnoreEnd
$digits = 'abcdefghijklmnopqrstuvwxyz0123456789';
return substr($digits, $digit, 1);
}