php⽣成表单url串禁⽌转义并解决中⽂字符乱码function create_auto_html($params, $action)
{
$encodeType = isset ($params ['encoding']) ? $params ['encoding'] : 'UTF-8';
$html = <<<eot
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$encodeType}" />
</head>
<body onload="javascript:document.pay_form.submit();">
<form id="pay_form" name="pay_form" action="{$action}" method="post">
eot;
foreach ($params as$key => $value) {
$html .= " <input type=\"hidden\" name=\"{$key}\" id=\"{$key}\" value=\"{$value}\" />\n";
}
$html .= <<<eot
</form>
</body>
</html>
eot;
return$html;
url编码处理}
View Code
url串禁⽌转义并解决中⽂字符乱码:
$data = array(
'devi' => 'y',
'ap' => 'ios',
'user' => 'w5807',
'login' => '随便',
'loginpwd' => 'e10adc3949ba59abbe56e057f20f883e',
'mobile' => '155********',
'regReferee' => 'aaa',
'atm' => 'e10adc3949ba59abbe56e057f20f883e'
);
$c_data = urldecode(htmlspecialchars(http_build_query($data)));//禁⽌字符串转义和中⽂字符乱码——————————————————
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论