Possible Duplicate:
php variable as conditional assignment
I am trying to concatenate a conditional assignment through php variables like this
$cndtnal='&& $x==4';
if($y==5 eval($cndtnal)){
print 'Hello World';
}
But I am getting a Parse error: syntax error, unexpected $end in : eval()'d code on line 1.
I have tried too :
$cndtnal='&& $x==4';
if (eval('$y==5'.$cndtnal)){
print 'Hello World';
}
But I get the same error.
Thanks.