How to get rid of this empty line at the beginning
Source: Internet
Author: User
How do I get rid of this empty line at the beginning?
I need to refer to my own other PHP file before outputting html, as follows:
Include ("test.php");
?>
......
Results as long as the reference, no matter how to write in test.php, the output page will be at the beginning of the output of a blank line, but look at the page in the original code is never
or carriage return line break, even if test.php is completely empty. That's what happens. However, if the test.php code is written directly in the main program instead of the include ("test.php"), there will be no blank lines.
Why is this? If I have to start with include, how do I fix it?
------Solution--------------------
This is not found under Firefox chrome.
Guess it's UTF8 's head problem.
------Solution--------------------
BOM header?
Internationalization? I really don't know how many people can read Chinese.
------Solution--------------------
May be in your include file Then there are line breaks, such as:
...
?>
Over here
------Solution--------------------
You use Notepad to open this HTML file, the empty line of the head to remove it
------Solution--------------------
File format with UTF-8 No BOM try, recommended to modify the file format notepad++
------Solution--------------------
Change the encoding of the test.php file to Utf-8, try it, there is a great possibility of BOM header
------Solution--------------------
File encoding to Utf-8, try, GBK code may have BOM header
------Solution--------------------
Set encoding
------Solution--------------------
Explore
The front add no header ("content-type:text/html;charset=utf-8") problem is still, and does not affect the session, so it is not involved in the BOM head bad said.
But it's definitely about the Utf-8 code, and now I'm the main php file includes another php file, two PHP file storage format is Utf-8 (windowsxp system), I found that as long as any one of the files of the storage encoding ANSI, empty line is gone. But holding ...
------Solution--------------------
A murder caused by a blank line. This concludes ...
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.