Possible Duplicate:
echo inside if loop
I am trying to evaluate strings like "0>0.1","0<0.2" etc. suppose $string = "0>0.1" and i write if($string) it is always evaluating it to true since it is a non-empty string so i tried this way if(echo $string) and this time i am getting an error saying that i cannot echo inside if
You need to be using eval
. Of course, this is very, very dangerous, so use it with caution.