Is it possible at all to pass variable to "if" statment as expression? Example: ... $expr = "$a == $b"; if ($expr) { // this line should be taked by parser as "if ($a == $b) {" ... } ...
$a = 1; $b = 1; $expr = ($a == $b); if ($expr) { true }
Thanks, it really works.
Originally posted by thefury $a = 1; $b = 1; $expr = ($a == $b); if ($expr) { true }
It's no way different from if ($a == $b) {}, here's no passing as variable. Maybe trick one may need is if (eval($expr)) {}.