What are the potential security risks of displaying email addresses as links using PHP?

Displaying email addresses as links using PHP can expose them to email harvesting bots, leading to an increase in spam emails. To mitigate this risk, you can obfuscate the email address by encoding it using PHP functions like base64_encode or using JavaScript to dynamically generate the email address.

<?php
$email = 'example@example.com';
$encoded_email = base64_encode($email);
echo '<a href="mailto:' . base64_decode($encoded_email) . '">' . base64_decode($encoded_email) . '</a>';
?>