In a PHP if statement, Is it possible to use a variable's content as its...

M G

New member
...expression rather than evaluating it? Example:
$var[1] = '$this or $that';
$var[2] = '$this and $that';


// This would evaluate as true. Is there a way to insert the value of the variable instead?
if ($var[1]){
echo $var[1];
}
 
Back
Top