dsh1956 2012-03-17 07:12
浏览 15
已采纳

将HTML嵌入PHP的正确方法

I have a define.php page that has many variables in it. I use to include in any other PHP file I make.

There is a variable named $encodingdeclaration which has <meta http-equiv="Content-Type" content="text/html; charset=utf-8">.

The script now is becoming unresponsive: that because of an extra semicolon used after text/html, What to do?

  • 写回答

3条回答 默认 最新

  • dse55384 2012-03-17 12:16
    关注

    meta http-equiv should be moved to .htaccess file Adding it inline the way you do will cause html validating to fail.

    If its a html5 page, simply add the below before your [title] tag

    <meta charset="UTF-8" />
    

    Also use double quotes for strings such as these.

    $encodingdeclaration = "<meta charset=\"UTF-8\" />";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部