MagicT
19 Jul 2009, 10:16 PM
When echoing the following variable, I get no problems:
$cat{$i}
$cat just becomes $cat1, $cat2, $catdog, etc etc. (whatever $i is).
My question is, how do I access this variable variable name in a script? I need to write a loop, where it adds the specified number of variables to an array, but...
"
for ($i = 0; $i < $amount; $i++) {
array_push($array, $doc{$i});
}
"
...does not work.
I've fallen and I can't get up again,
MagicT
$cat{$i}
$cat just becomes $cat1, $cat2, $catdog, etc etc. (whatever $i is).
My question is, how do I access this variable variable name in a script? I need to write a loop, where it adds the specified number of variables to an array, but...
"
for ($i = 0; $i < $amount; $i++) {
array_push($array, $doc{$i});
}
"
...does not work.
I've fallen and I can't get up again,
MagicT