note 62830 added to function.eval

From: Date: Fri, 10 Mar 2006 13:42:22 +0000
Subject: note 62830 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-105197@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/62830 Del: integrated -- http://master.php.net/note/delete/62830/integrated Del: useless -- http://master.php.net/note/delete/62830/useless Del: bad code -- http://master.php.net/note/delete/62830/bad+code Del: spam -- http://master.php.net/note/delete/62830/spam Del: non-english -- http://master.php.net/note/delete/62830/non-english Del: in docs -- http://master.php.net/note/delete/62830/in+docs Del: other reasons-- http://master.php.net/note/delete/62830 Reject -- http://master.php.net/note/reject/62830 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#105197) next »