This is a php boolean expression verifier/parser I built for a Postgres full text index search input.
A while back I searched quite heavily, mainly on Google, to find a PHP program to validate a boolean expression, specifically for the format used in querying a Postgres database with a full text field. After trial and error, I came up with the function here, which seems to do the trick. I put it on Github in case anybody needs to validate a boolean expression in PHP.
//Change Log
2014-01-16 -- Fully redid the function making major logical and programming changes
2013-12-22 -- Changes made to remove notices for PHP 5.4
2013-11-06 -- Initial upload and get everything going