What are some alternative methods to captchas for combating spam in PHP contact forms?

The issue with captchas is that they can be frustrating for users and sometimes difficult to solve. One alternative method to combat spam in PHP contact forms is to implement a hidden field that is only visible to bots. If the hidden field is filled out, the form submission can be rejected.

<?php
if($_POST['hidden_field'] != '') {
    // Bot detected, reject form submission
    die('Bot detected, form submission rejected');
} else {
    // Process form submission
}
?>