What are the best practices for setting the character encoding in PHP scripts to ensure proper display of special characters?

When working with special characters in PHP scripts, it is important to set the character encoding properly to ensure that the special characters are displayed correctly. The recommended practice is to set the character encoding to UTF-8 in your PHP scripts using the header() function.

<?php
header('Content-Type: text/html; charset=UTF-8');
?>