In the context of PHP development, what are some alternative methods to using "mailto" links for email addresses in a web application?

Using "mailto" links for email addresses in a web application can expose the email address to spam bots, leading to an increase in unwanted emails. An alternative method is to use PHP to obfuscate the email address by converting it into a JavaScript function that dynamically generates the email address on the client-side. This helps protect the email address from being easily harvested by spam bots.

<?php
function obfuscate_email($email) {
    $email_parts = str_split($email, 1);
    $obfuscated_email = '';
    
    foreach ($email_parts as $part) {
        $obfuscated_email .= '&#'.ord($part).';';
    }
    
    return $obfuscated_email;
}

$email = 'example@example.com';
$obfuscated_email = obfuscate_email($email);
?>

<script>
document.write('<?php echo $obfuscated_email; ?>'.replace(/&#(\d+);/g, function(match, dec) {
    return String.fromCharCode(dec);
}));
</script>