How can whitespace and empty lines before PHP opening tags affect the functionality of PHP scripts?

Whitespace and empty lines before PHP opening tags can cause unwanted output, such as headers already sent errors, which can disrupt the functionality of PHP scripts. To solve this issue, ensure that there is no whitespace or empty lines before the PHP opening tag `<?php`.

&lt;?php
// PHP code here