是否有任何特定的标题我应该为纯PHP页面服务?
我没有重定向用户或类似的东西,我的标记已经有一个doctype和<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
我还需要从PHP header()吗? 它应该有什么具体的东西吗?
Is there any specific header I should be serving for plain php pages?
I'm not redirecting the user or anything like that and my markup already has a doctype and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Do I also need to start with a PHP header()? Is there anything specific that it should have?
最满意答案
header()用于发送HTTP头。 如果你问,你可能还不需要它,尽管你可以通过这样做来摆脱你的meta :
header('Content-Type: text/html; charset=utf-8');请记住, header()指令必须都在发送任何内容之前,否则您将收到错误。
header() is for sending HTTP headers. If you're asking, you probably don't need it yet, though you could get rid of your meta by doing:
header('Content-Type: text/html; charset=utf-8');Remember that header() directives must all come before any content has been sent, otherwise you will get errors.
更多推荐
发布评论