function gbk_ascii_to_unicode($ascii_str) { $unicode_str = ''; for ($i = 0; $i < strlen($ascii_str); $i++) { $code = ord($ascii_str[$i]); if ($code > 127) { $unicode_str .= '&#' . sprintf('%04d', bindec(decbin(ord($ascii_str[$i]))) + 0x8080) . ';'; } else { $unicode_str .= $ascii_str[$i]; }
} return $unicode_str; }

PHP 函数:GBK 编码 ASCII 转 Unicode

原文地址: https://www.cveoy.top/t/topic/msFC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录