dscrb00804 2014-10-06 09:54
浏览 72
已采纳

php插入'随机'(probs不是随机但不是我的反正)字符

I've tried what seem to be the usual fixes I've seen from replies around on these boards and other places found on Google and I've only managed to change the characters.

even using <?php ?> will end up inserting:

^ seems not much is showing up when I copy and paste. you can view the link http://boxxie.org/itd/header.php

as you can see theres a lot of blank spaced inserted before the html which makes for some undesired results

I tried adding in:

header("Content-Type: text/html; charset=utf-8");

and

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

those got rid of the actual character that was being put there but surely nothing should be there at all.

EDIT:

heres code for the whole page at moment:

<?php
//    error_reporting( E_ALL );
//    ini_set( "display_errors", 1 );
header("Content-Type: text/html; charset=utf-8");
?>​
<!DOCTYPE html>
<html>
    <head>
        <title>In The Distance</title>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>

        <div id="header"><h1>Some text here</h1><h2>lorem ipsum etcetera?</h2></div>
        <div id="left"></div>
        <div id="content"></div>
        <div id="footer"></div>
    </body>
</html>
  • 写回答

3条回答 默认 最新

  • dongpo7467 2014-10-06 16:13
    关注

    Ok seems there was a problem with my editor rather than my php. It had entered a non space white character after the first closing php tag. if you copy the code into a text editor goto the end of the line and press the left and right arrow keys you'll notice you'll have to press it twice before it actually moves. deleted that and all works now. Cheers for the suggestions though!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭