note 64288 rejected from language.variables.variable by bjori
| From: | bjori@php.net | Date: | Tue, 11 Apr 2006 18:47:22 +0000 |
| Subject: | note 64288 rejected from language.variables.variable by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107792@lists.php.net to get a copy of this message | ||
Note Submitter: watt dot john dot runyon at gmail dot com
----
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
}