How to convert an array to variables?
| From: | Charles Kline | Date: | Sat, 15 Mar 2003 18:52:10 +0000 |
| Subject: | How to convert an array to variables? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139801@lists.php.net to get a copy of this message | ||
Hi all,
I have an array that gives me this when I do:
print_r($my_array);
Array
(
[0] => Array
(
[dra_id] => 5
)
[1] => Array
(
[dra_id] => 8
)
[2] => Array
(
[dra_id] => 9
)
)
using a foreach() I want to create a variable with a unique incremental name for each of the values.
for example:
$dra_1 = 5;
$dra_2 = 8;
$dra_3 = 9;
How would I do this? A variable that has a variable name based on a counter in the loop? Not sure the syntax for that.
Thanks
Charles