Are there specific guidelines or best practices for specifying UTF-8 encoding in PHP to ensure valid XHTML output?

When outputting XHTML content in PHP, it is important to specify the UTF-8 encoding to ensure proper handling of special characters. This can be done by setting the content type header to include the charset parameter with the value "UTF-8". This ensures that the browser interprets the content correctly and displays it as intended.

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