note 62831 added to function.eval
| From: | aleosha at yandex dot ru | Date: | Fri, 10 Mar 2006 13:43:28 +0000 |
| Subject: | note 62831 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105198@lists.php.net to get a copy of this message | ||
There's a minor mistake in example that shows how to correctly use EVAL with IF statements.
Instead of
$str="\$refer=&\$total".$i.";";
eval($str);
Wich just puts value "total2" in your $refer variable, you should use
$str="\$refer=&\$$total".$i.";";
This one will create the real referrer to the value of $total2 (5, in our case).
----
Server IP: 62.90.26.70
Probable Submitter: 217.132.248.97
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/note/edit/62831
Del: integrated -- http://master.php.net/note/delete/62831/integrated
Del: useless -- http://master.php.net/note/delete/62831/useless
Del: bad code -- http://master.php.net/note/delete/62831/bad+code
Del: spam -- http://master.php.net/note/delete/62831/spam
Del: non-english -- http://master.php.net/note/delete/62831/non-english
Del: in docs -- http://master.php.net/note/delete/62831/in+docs
Del: other reasons-- http://master.php.net/note/delete/62831
Reject -- http://master.php.net/note/reject/62831
Search -- http://master.php.net/manage/user-notes.php