Re: There's got to be a better way
- From: Snahad00 <snahad00@xxxxxxxx>
- Date: Sat, 24 Mar 2007 08:12:39 +0100
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,
.
- Follow-Ups:
- Re: There's got to be a better way
- From: Rami Elomaa
- Re: There's got to be a better way
- References:
- There's got to be a better way
- From: Mary Pegg
- There's got to be a better way
- Prev by Date: Video sharing social network Teenwag seeks great hackers we ll wear red T-shirts at startup school $100K $5K sign on $2k referral
- Next by Date: explode
- Previous by thread: There's got to be a better way
- Next by thread: Re: There's got to be a better way
- Index(es):
Relevant Pages
|