I have a website with a white space problem. I am including a few files before the doctype and this is causing a white space to be outputted.
After searching I have
OK, these steps should fix your problem:
Go through all PHP files on your site. If the file ends with ?>
(and possibly some whitespace), remove the ?>
. (Of course, if there's some HTML text after the ?>
then you shouldn't remove it.)
While doing the above, also check that there's no whitespace in front of the first in any files.
If you still have problems after that, check for invisible characters in front of the . There are several ways to do that, but looking at a hex dump of the files is one good way. The first two bytes of each PHP file (that doesn't begin with HTML text) should be
(hex
3c 3f
).
In the unlikely event that those steps won't solve the problem, let us know (and preferably include a link to a page where the problem occurs, so that we can check the output ourselves).