phpajaxwhitespaceremoving-whitespace

Why does php include statement return whitespace as ajax response


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

example

And how do I fix it?


Solution

  • 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.