Why does php include statement return whitespace a

2019-09-13 21:35发布

问题:

An example of my question in the title demonstrates the problem I'm having.

example

sorry don't know how to use jsfiddle.

And how do I fix it?

回答1:

It seems your "empty file" contain an empty line, http://wx2fly.com/test/emptyFile.php , which means it's not empty !

I think you can fix your problem by making your empty (or not) file starts with <?php, and be sure the php tag is NOT closed at the end of the file.