I have a form where the user can create their own condition. E.g
<select name="operator">
<option value="==">(==) Equal</option>
<option value="!=">(!=) - Not Equal</option>
<option value=">">(>) - Greater than</option>
<option value="<">(<) - Less than</option>
<option value=">=">(>=) - Greater than or equal to </option>
<option value="<=">(<=) - Less than or equal to </option>
</select>
How could I parse the operator so that its actually a string but php interprets it as a condition operator?
if($column $operator $value){
}
The long winded way of doing it would be something like this:
switch($operator){
case '!=':
if($column != $value){
}
break;
case '<=':
case '<=':
if($column <= $value){
}
break;
}