php接收一维数组中文乱码解决
遍历:
foreach ($_REQUEST as $key => $value)
{
echo "Key: $key; Value:$value<br />\n";
}
foreach (array_merge($_GET,$_POST) as $name => $value) {
if ($name != 'sig')
$str .= $name.$value;
}
====只取_GET,_POST.
参数中文乱码解决:
foreach ($_REQUEST as $key => $value)
{
// echo "Key: $key; Value: $value<br/>\n";
$_REQUEST[$key] =$this->togbk($value);
}
public function togbk($str){
$encode =mb_detect_encoding($str, array("ASCII","GB2312","UTF-8","GBK","BIG5"));
$str = iconv($encode,"GBK//IGNORE",$str);
return ($str);
}
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/55294140
- 点赞
- 收藏
- 关注作者
评论(0)