Requests_IDNAEncoder::encode()
最后更新于:2021-11-26 03:19:19
Requests_IDNAEncoder::encode( string$string)Encode a hostname using Punycode
参数
- $string
-
(string) (Required) Hostname
响应
(string) Punycode-encoded hostname
源文件
文件: gc-includes/Requests/IDNAEncoder.php
public static function encode($string) {
$parts = explode('.', $string);
foreach ($parts as &$part) {
$part = self::to_ascii($part);
}
return implode('.', $parts);
}