How can PHP developers protect their email addresses from being harvested by spam bots through contact forms?

Spam bots often harvest email addresses from websites, including contact forms, to send unsolicited emails. To protect email addresses from being harvested, PHP developers can use techniques like encoding the email address or implementing CAPTCHA verification in the contact form.

<?php
// Encode the email address to prevent harvesting by spam bots
$email = 'example@example.com';
$encoded_email = str_rot13($email);

// Display the encoded email address in the contact form
echo '<a href="mailto:' . $encoded_email . '">' . $encoded_email . '</a>';
?>