Using a variable as a variable name
| From: | Stephen Rhodes | Date: | Wed, 04 Sep 2002 11:35:40 +0000 |
| Subject: | Using a variable as a variable name | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21562@lists.php.net to get a copy of this message | ||
Hi
I am wanting to use the value in a variable as a variable name. I know it is
possible but do not remember how to do it - what function to call.
Example
$section1 = "SECTION 1";
$section2 = "SECTION 2";
// I want to have a for loop that will call these variables.
eg for ($i=1;$i<3;$i++)
//Now I want to call $section1, and $section2 by using $i
which will first equal 1 and then 2.
Cheers
Steve