What role does the encoding declaration (e.g., UTF-8 without BOM) play in resolving Umlaut encoding issues in PHP scripts when interacting with external APIs or websites?

When interacting with external APIs or websites, Umlaut encoding issues can arise due to differences in character encoding. To resolve this, specifying the correct encoding declaration (e.g., UTF-8 without BOM) in PHP scripts ensures that the Umlaut characters are properly handled and displayed.

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