In the post A More Accessible Alternative to Graphical Capchas, I discussed a method of using a question/answer system for determining whether one is dealing with a human visitor or a naughty robot. The example was given in Perl, but I said that it would be easy to adapt for PHP. This wasn't entirely correct, as PHP has a different approach to arrays from Perl, but I have now done it.
I have posted an example implementation on this site, which also provides links to download the PHP source files.
Notes on the routine that does all the work are interspersed with the code in the file textcaptcha.php