How should PHP tags be used in scripts to avoid header modification errors in PHP?

When using PHP tags in scripts, it is important to ensure that there is no whitespace or output before the opening PHP tag <?php. This can cause header modification errors in PHP scripts. To avoid this issue, make sure to start your PHP script with <?php immediately without any whitespace or output before it.

&lt;?php
// Your PHP code here