Forum Moderators: coopster
$a = 'no';
$the_condition = '$a == "yes"';
if($the_condition)
{
echo "$a is equal to yes";
}
else
{
echo "$a is not equal to yes";
}
This will always evaluate as true and print yes because $the_condition variable is defined.
Is there any syntax so that I can have it actually evaluate the condition within the variable and whether that is true or not?
Variable condition statements [webmasterworld.com]