note 69995 deleted from function.eval by bobby
| From: | bobby@php.net | Date: | Fri, 29 Sep 2006 15:23:48 +0000 |
| Subject: | note 69995 deleted from function.eval by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117838@lists.php.net to get a copy of this message | ||
Note Submitter: Diz
----
This edits the little snipet bellow which doesn't work
<?php
// make some variables
$five = 5;
$three = 3;
$lessthan = "<";
// place them into a string
$mystring = "$five.$lessthan.$three"; // DOUBLE QUOTES
echo $mystring."<br>"; // lets see it before eval
if (eval("return ".$mystring.";")) // if(5<3)
{
echo "FALSE";
} else {
echo "TRUE";
}
?>
returns
FALSE
... of course
Notice that $mystring now has double quotes and works :)
incidentally this string could also be writen
<?php
$mystring = "$five $lessthan $three";
?>
without the points which also seems to work