Hi Folks,
I would like to forward an expression to an if-statement via a variable.
Like:
$a=10;
$b=20;
$expr="$a > $b";#this should be my if-expression
if ($expr) do something;#test should be if($a > $b)
Of course this does not work, as $expr is simply determined as being true.
Is there any chance to get this working?
Thanks in advance,
Chris
I would like to forward an expression to an if-statement via a variable.
Like:
$a=10;
$b=20;
$expr="$a > $b";#this should be my if-expression
if ($expr) do something;#test should be if($a > $b)
Of course this does not work, as $expr is simply determined as being true.
Is there any chance to get this working?
Thanks in advance,
Chris
Comment