What are common issues with character encoding declarations in PHP scripts and how can they be resolved?

Common issues with character encoding declarations in PHP scripts include incorrect or missing declarations, leading to garbled or incorrectly displayed text. To resolve this, ensure that the correct character encoding declaration is included at the top of your PHP script, such as UTF-8.

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