开发者

php strange outputs before <!doctype>

开发者 https://www.devze.com 2023-01-24 07:30 出处:网络
I have the following pages. index.php <?php require(\'configure.php\'); ?> configure.php 开发者_开发技巧<?php

I have the following pages.

index.php

<?php
require('configure.php');
?>

configure.php

开发者_开发技巧<?php
die();
?>

The above outputs a "-" (dash) when i copy it, it looks as if it's a new line or something of that nature. Its the first time i get this kind of behaviour.

The problem stands that if anything is before the the browser does not render the source properly.

any one come across this?


You may be saving your file as UTF-8. Save it as 'UTF-8 without BOM' or ASCII and the problem will be solved.

The 'Byte order mark' in UTF-8 encoding creates the problem. Use any good editor like Notepad++ and change the encoding of the files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号