Simple question really. I have come across an issue with work where it would be ideal to store >= <= and == into a variable to spit out into certain if statements wherever the case may be.
$numb1 = 5
$numb2 = 10
$option = >=
if($numb1 $option $numb2)
You can’t put a var for testing this in a control instruction.
This will return some :
syntax error, unexpected T_VARIABLEYou could use some eval() to do it, but it’s not advisable.
Perhap’s you could make something different with the following :
Or with a function like the following