How to manipulate and validate string containing conditions that will be evaluated by php
问题 Part of the program I am creating consists of the user creating conditions which I will store in a mysql database. I want the syntax to be somewhat easier than what php allows but since this will ultimately be run as php code using eval() it needs to have valid syntax. For example: User Input: 4<var1<=9 AND var2<6 Result should be: 4<var1 AND var1<=9 AND var2<6 Before this is eval'd I surround it with an if statement that simply returns true. What would be a good way to detect and split that