Home  >  Article  >  Backend Development  >  $_session为啥ie中保存汉字乱码,ff,chrome却都正常

$_session为啥ie中保存汉字乱码,ff,chrome却都正常

WBOY
WBOYOriginal
2016-06-13 13:08:021082browse

$_session为什么ie中保存汉字乱码,ff,chrome却都正常
前几天发了帖子求助,无果,(问题是ie下图片显示不了,ff和chrome下正常)
自己试着echo $_SESSION["goodsid"],
发现
ff下显示session为 袁002@袁003@袁004@ 汉字显示正常,
ie下显示session为?002@?003@?004@, 数字前面的汉字显示成了框框.
肯定是session中汉字存储出了问题,
我的文件都存成了utf-8格式,
session文件为

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
session_start();
header ( "Content-type: text/html; charset=utf-8" );
if($_SESSION["goodsid"]==""){
    $_SESSION["goodsid"]=$_GET["id"]."@";
}else{
    $array=explode("@",$_SESSION["goodsid"]);
    if(in_array($_GET["id"],$array)){
        $key=array_search($_GET["id"],$array);
        $array[$key]="";
        $_SESSION["goodsid"]=implode("@",$array);
        }else{
        $_SESSION["goodsid"].=$_GET["id"]."@";
        }
}



请问,我哪里出了问题呢???

------解决方案--------------------

人为设定了浏览器编码格式,而非 自动选择?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn