I have set of rules which involves comparison operators. I want to do some task based on the value of comparison operator stored in the rule. I am doing it in the following way but it is not working. Check the following code
if($benRules[$i]['amountCriteria']=='Greater than')
$comparison='>';
if($benRules[$i]['amountCriteria']=='Equal to')
$comparison='==';
if($benRules[$i]['amountCriteria']=='Less than')
$comparison='<';
if($value['1'].$comparison.$value[$i]['2']){
debug('Condtion checked');
}
problem is it always checks the condition to be true. it takes whole parameter inside IF condition to be string so as long as that string is not empty is executes the code inside the parenthesis. Please help me here.
Equal tois==not just one=