乱码是怎么回事

WBOY
Release: 2016-06-20 12:38:18
Original
1200 people have browsed it

setcookie("TestCookie","",time()-3600);
if(!empty($_COOKIE["TestCookie"]))
echo "testcookie值为:".$_COOKIE["TestCookie"]."
";
else 
echo "testcookie被注销。
";
print_r($_COOKIE);
?>


回复讨论(解决方案)

经测试,没有看到乱码

难道又是人品的问题?

你这里没有设置 字符编码,这时浏览器就会使用自己的默认编码

如果你的文件编码与浏览器的相同,那就不显示乱码,如果正好不相同,那就乱码了呗

最好你设置一下文件编码,那浏览器就知道是哪种编码方式,这样就不会乱码了

你可以查看下这个程序文件的编码, 还有就是用header函数设置浏览器查看的编码

主要看你是怎样的一种乱码,乱码有很多种可能

检查下文件编码和浏览器编码是否一致

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!