Skip to content
PHP Logo

How can the use of whitespace or blank lines before the <?php tag impact PHP scripts and cause errors?

When whitespace or blank lines are present before the <?php tag in a PHP script, it can cause output to be sent to the browser prematurely, leading to headers already being sent errors. To solve this issue, ensure that there is no whitespace or blank lines before the <?php tag in your PHP scripts.

php
<?php
// PHP code here