note 64288 added to language.variables.variable

From: Date: Tue, 11 Apr 2006 18:39:23 +0000
Subject: note 64288 added to language.variables.variable
Groups: php.notes 
Request: Send a blank email to php-notes+get-107790@lists.php.net to get a copy of this message
I am trying to develop a 'message board' and am using "foreach" statements as part of it. I put a 'var var' (as I call it) into the foreach 'AS' statement-part-thing foreach ($category as $cat) {//let's say $cat now equals 1 (int) echo $cat;//echoes 1 //get every forum in category foreach (${$cat.'_forum'} as $f) {//let's say makes $f = value of $1_forum['1'] since $cat = 1 echo "-'" .$f. "'"//echo -'FORUM' } echo "<hr>";//add a horiz. rule to the page between each category } ---- Server IP: 66.163.161.117 Probable Submitter: 66.166.62.34 (proxied: 127.0.0.1) ---- 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/language.variables.variable.php Edit -- http://master.php.net/note/edit/64288 Del: integrated -- http://master.php.net/note/delete/64288/integrated Del: useless -- http://master.php.net/note/delete/64288/useless Del: bad code -- http://master.php.net/note/delete/64288/bad+code Del: spam -- http://master.php.net/note/delete/64288/spam Del: non-english -- http://master.php.net/note/delete/64288/non-english Del: in docs -- http://master.php.net/note/delete/64288/in+docs Del: other reasons-- http://master.php.net/note/delete/64288 Reject -- http://master.php.net/note/reject/64288 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#107790) next »