How can HTML entities like ü be properly displayed as special characters in PHP?

HTML entities like ü can be properly displayed as special characters in PHP by using the html_entity_decode() function. This function decodes all HTML entities in a string, converting them back to their corresponding special characters.

$text = "ü is a special character in HTML entities.";
$decoded_text = html_entity_decode($text);
echo $decoded_text;