使用zendstudio10.6 编写第一个php页面,就出现中文乱码问题,在编写之前,我设置了window->proferences->general->workspace 的编码,还有file中的编码,但是还是出现乱码。在网上搜集大多数的解决中文乱码的方法也是上面的设置,最终发现如果你写的php页面,后缀为.php,需要设置header如下:
<?php
header("content-type:text/html;charset=utf-8");
?>
如果后缀是.html文件,需要<meta http-equiv="content-type" content="text/html charset=utf-8"/>。
这样的话,就不是乱码了,谁有更好的方法可以交流。