I would like to parse boolean expressions in PHP. As in:\[code\]A and B or C and (D or F or not G)\[/code\]The terms can be considered simple identifiers. They will have a little structure, but the parser doesn't need to worry about that. It should just recognize the keywords \[code\]and or not ( )\[/code\]. Everything else is a term.I remember we wrote simple arithmetic expression evaluators at school, but I don't remember how it was done anymore. Nor do I know what keywords to look for in Google/SO.A ready made library would be nice, but as I remember the algorithm was pretty simple so it might be fun and educational to re-implement it myself.