What are some best practices for avoiding invisible characters or BOM issues when saving PHP files in text editors like UltraEdit?

When saving PHP files in text editors like UltraEdit, it's important to avoid invisible characters or Byte Order Mark (BOM) issues that can cause unexpected behavior in your code. To prevent this, make sure to save your PHP files with UTF-8 encoding without BOM. You can do this by configuring your text editor settings to save files in UTF-8 without BOM.

<?php
// Ensure PHP files are saved with UTF-8 encoding without BOM
// Add this line at the beginning of your PHP files
header('Content-Type: text/html; charset=utf-8');