html php元字符集UTF-8不工作? [英] html php meta charset UTF-8 not working?

查看:150
本文介绍了html php元字符集UTF-8不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

浏览器显示 而非'

在一个php文件,几乎只有html。我使用PHP只从联系表单发送信息到我的邮件地址。

i'm kind of stuck on a php file with almost only html in it. I use PHP only to send information from a contact form to my mail adres.

在localhost上开发网站时,一切都很好。

When developing the website on localhost everything was all fine. After uploading to my server it messes up the special characters.

我的元标签如下所示:

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

如果有人可以请帮助我,将非常感激。

If someone could please help me it would be highly appreciated.

推荐答案

将它添加到您的php文件中的标题,并让我知道是否解决 -

Add this to the header in your php file and let me know if it solves or not -

header('Content-Type: text/html; charset=UTF-8');

这篇关于html php元字符集UTF-8不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆