在我的源文件的开头是什么? [英] What's  sign at the beginning of my source file?

查看:246
本文介绍了在我的源文件的开头是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP源文件,字符自动添加到!我不知道他们来自哪里。我没有得到任何解析错误,但它导致在执行文件的奇怪的行为。例如。标题位置功能有时不工作!我很好奇这些类型的符号是如何自动生成的?我使用UTF-8编码&在Notepad ++或Windows记事本中不显示符号¨¿¿,但使用Netbeans IDE。

I have a PHP source file where  characters automatically got added in! I don't know from where they have come. I'm not getting any parse errors but it results in weird behavior in the execution of the file. E.g. header location functionality is not working sometimes! I'm curious how these kind of symbols are getting auto generated? I'm using UTF-8 encoding & the sign  is not showing in Notepad++ or Windows Notepad but with Netbeans IDE.

例如。代码:

<?php
echo "no errors!";
header("Location: http://stackoverflow.com");
exit;
?>

这是什么?我如何防止它?

What is this? How can I prevent it?

推荐答案

您可以将文件保存为UTF-8与BOM。您应该将它们保存为UTF-8而不使用BOM。

You propably save the files as UTF-8 with BOM. You should save them as UTF-8 without BOM.

这篇关于在我的源文件的开头是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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