Note Submitter: Diz
----
Thought I'd simplify the dynamic IF statement a little
<?php
// make some variables
$five = 5;
$three = 3;
$lessthan = "<";
// place them into a string
$mystring = '$five.$lessthan.$three';
echo $mystring."<br>"; // lets see it before
eval
if (eval("return ".$mystring.";")) //
if(5<3)
{
echo "FALSE";
} else {
echo "TRUE";
}
?>
returns
FALSE
... of course
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|