What are the best practices for ensuring that PHP files are saved as UTF-8 without BOM to avoid character encoding issues?

When saving PHP files as UTF-8 with BOM, it can cause character encoding issues in your code. To avoid this problem, make sure to save your PHP files as UTF-8 without BOM. This can be achieved by configuring your text editor or IDE to save files in this specific encoding.

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