|
Posted by Norman Peelman on 05/15/05 03:47
"Shannon A." <appel@erzo.org> wrote in message
news:1116096102.753079.138950@g44g2000cwa.googlegroups.com...
> I have a set of variables called $topten_1, $topten_2, $topten_3, etc.
>
> I'd like to use a for($i = 1 ; $i<=10 ; $i++) loop to reference them,
> but can't quite figure out how to. These don't work:
>
> $topten_$1
> ${topten_$1}
> $"topten_$1"
>
> Is there someway to do this in PHP, or is the only answer to use an
> associative array?
>
> Shannon
>
Close... try:
${"topten_$i"}
Norm
---
FREE Avatar hosting at www.easyavatar.com
Navigation:
[Reply to this message]
|