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
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|