A good tip from Zend, who recommend omitting the closing PHP tag (?>
) when your files contain pure PHP code. This can prevent additional whitespace being inserted into the script output. Extra whitespace can cause problems, for example, if you are trying to set your own custom HTTP headers: nothing should be output before the call to the header
function. Otherwise, this classic error will occur:
Cannot modify header information - headers already sent by (output started at myinclude.php:16) in myscript.php on line 15