What are best practices for ensuring UTF-8 encoding in PHP scripts?

To ensure UTF-8 encoding in PHP scripts, it is important to set the default character encoding to UTF-8 using the `header()` function. Additionally, you should save your PHP files with UTF-8 encoding without BOM (Byte Order Mark) to avoid encoding issues.

// Set default character encoding to UTF-8
header('Content-Type: text/html; charset=UTF-8');

// Save PHP files with UTF-8 encoding without BOM
// Ensure there is no whitespace or output before this line in your PHP file