• It is crazy that some whitespace at the start or end of a php file causes wordpress to crap its pants. Whitespace has not been a problem since the 1980’s. What is the technical reason behind why this was ever a problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The white space may be problem because the whitespace after ?> may be treated as the HTML output and the headers are sent before they used to be sent. Mostly happens if there is whitespace in functions.php since here the output should not be sent.

    It is not the problem of PHP but the problem of not following the standard coding methods I guess ??

    Thread Starter paulmcwordpress

    (@paulmcwordpress)

    I don’t understand your answer, it appears to suggest that html cannot handle whitespace?

    No. The whitspace you leave will act as doing something like echo “”; in PHP which will send the browser the headers information and dataload, after which many functions may not work and throw fatal error called headers already sent.

    Just as an additional note, this is a PHP thing, not a WordPress thing. Any PH system,file, script has the same issue. That’s why you always start a plain PHP script file with <?php and nothing else before it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Handle whitespace which causes PHP errors’ is closed to new replies.