What are the potential issues that may arise when trying to display "#" in a URL parameter in PHP?

When trying to display "#" in a URL parameter in PHP, the "#" character is interpreted as an anchor tag and may not be passed correctly. To display "#" in a URL parameter, you can use the urlencode() function to encode the "#" character as "%23".

$url_parameter = "example.com/page.php?param=" . urlencode("#");
echo $url_parameter;