PHP中文编码问题

(0 comments)

在测试PHP页面中文编码时发现,在页面中设置编码方式不起作用。

<meta http-equiv="Content-Type" 
content="text/html; charset=utf-8">

这是因为PHP配置文件中设置了默认的文件编码方式,因此解析时会忽略页面中设置的编码方式。

default_mimetype = "text/html"
;default_charset = "iso-8859-1"

如果要使页面中的设置生效,必需将这个选项设置为空(注释掉没有用):

default_mimetype = ""
Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required