I have a need to evaluate user-defined logical expressions of arbitrary complexity on some PHP pages. Assuming that form fields are the primary variables, it would need to:
If I understand the problem correctly, you want the users to write out functions in non-PHP, and then have PHP interpret it?
If so, you could simply take their string and replace "lt" with "<" and "gt" with ">" ... then do eval().
I have a hunch the problem isn't this simple, but if it is, eval() could do the job. Of course, then you're opening yourself up for any kind of attack.