note 69993 deleted from function.eval by bobby

From: Date: Fri, 29 Sep 2006 15:24:25 +0000
Subject: note 69993 deleted from function.eval by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-117839@lists.php.net to get a copy of this message
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

« previous php.notes (#117839) next »