Is converting email addresses to Hex code a reliable method in PHP to deter spam bots from harvesting them?

Converting email addresses to Hex code in PHP can be a method to deter spam bots from harvesting them, as it makes it more difficult for bots to recognize and extract the email addresses. However, it is not foolproof and determined spam bots may still be able to decode the Hex code. Another approach to consider is using a combination of techniques such as JavaScript obfuscation, server-side validation, and CAPTCHA to further enhance the security of email addresses on a website.

<?php
function convertEmailToHex($email) {
    $hexEmail = '';
    for ($i = 0; $i < strlen($email); $i++) {
        $hexEmail .= '&#x' . dechex(ord($email[$i])) . ';';
    }
    return $hexEmail;
}

$email = 'example@example.com';
$encodedEmail = convertEmailToHex($email);
echo 'Encoded Email: ' . $encodedEmail;
?>