function encodeURIComponent($text) {
preg_match_all("/[\x81-\xfe]?./",$text,$regs);
$rtext = "";
foreach($regs[0] as $v) {
$ch = iconv("gb2312","UTF-8",$v);
$rtext .= sprintf("%%%02X%%%02X%%%02X",ord($ch[0]),ord($ch[1]),ord($ch[2]));
}
return $rtext;
}
$text = "时义浩维";
echo encodeURIComponent($text);
preg_match_all("/[\x81-\xfe]?./",$text,$regs);
$rtext = "";
foreach($regs[0] as $v) {
$ch = iconv("gb2312","UTF-8",$v);
$rtext .= sprintf("%%%02X%%%02X%%%02X",ord($ch[0]),ord($ch[1]),ord($ch[2]));
}
return $rtext;
}
$text = "时义浩维";
echo encodeURIComponent($text);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货