The captcha helper provides a simple math captcha:
Creates the question from random variables, which are also saved to the session.
Checks the given answer if it matches the addition of the saved session variables.
if (isset($_POST['submit'])) { if (Captcha::correctAnswer($_POST['answer'])) { // Do something... } }