Posted by Snahad00 on 03/24/07 07:12
Mary Pegg pravi:
> There's got to be a better way:
> if (isset($c['s']['a1'])) echo $c['s']['a1']."<br>";
> if (isset($c['s']['a2'])) echo $c['s']['a2']."<br>";
> if (isset($c['s']['a3'])) echo $c['s']['a3']."<br>";
> if (isset($c['s']['a4'])) echo $c['s']['a4']."<br>";
> if (isset($c['s']['a5'])) echo $c['s']['a5']."<br>";
>
> but it's late and my brain is frazzled. Any ideas, oh PHP gurus?
>
Dunno about php but i think theoreticaly this should work:
$counter = 1
while $count < 6 do {
if (isset($c['s']['a.$counter'])) echo $c['s']['a$counter']."<br>";
$counter++;
}
regards,
[Back to original message]
|