How can UTF-8 BOM affect PHP scripts and cause header modification errors?

UTF-8 BOM (Byte Order Mark) can cause issues in PHP scripts by adding extra characters at the beginning of the file, which can interfere with header modification functions like `header()` or `setcookie()`. To solve this issue, you can remove the UTF-8 BOM from your PHP scripts by saving them without the BOM using a text editor that supports encoding options.

// Remove UTF-8 BOM from PHP script
ob_start();
include 'your_script_without_bom.php';
ob_end_clean();