How can HTML entities impact the display of links generated in PHP?

When HTML entities are used in the URL parameter of a link generated in PHP, it can cause the link to display incorrectly or not work as intended. To solve this issue, we can use the `htmlspecialchars` function in PHP to encode special characters in the URL parameter. This will ensure that the link is displayed correctly and functions properly.

<?php
$url = "https://example.com/page?param=" . htmlspecialchars($param);
echo "<a href='$url'>Link</a>";
?>