Fw: [PHP] how to.. arrays? :D

From: Date: Wed, 08 May 2002 21:41:37 +0000
Subject: Fw: [PHP] how to.. arrays? :D
Groups: php.general 
Request: Send a blank email to php-general+get-96682@lists.php.net to get a copy of this message
Hawk, you're very very close to making it work for you. The access key for $team must be in quotes otherwise you will be attempting to access the numerical indicies. This may not give you an error but you won't retrieve any values either. <? $g = 2; $r = 4; $tnme = 'GWDC'; $team = array ($g => array ($r => $tnme)); echo $team['2']['4']; ?> -Kevin ----- Original Message ----- From: "Hawk" <hw2k@barrysworld.com> To: <php-general@lists.php.net> Sent: Wednesday, May 08, 2002 3:11 PM Subject: [PHP] how to.. arrays? :D > Ok, the last time(about 5 min ago) you told me to use arrays, to be honest > I've never worked with arrays before, and I tried a little now, and I can't > figure out how to make multi level arrays with a loop, I tried with > $team = array($g => array($r => $tnme)); > > $g is group number 1 to 4 > $r is rank number 1 to 4 > $tnme is teamname, letters > > and I can't get a clear picture of how to get the info, but what I've seen > so far I have the thought that I should > print "{$team[1][2]}"; and so on, which should give me rank 2 from group 1.. > or am I wrong? > seems like something is wrong, since it wont work :D > > I looked at php.net but that doesn't make me any smarter .. hehe :P > > Håkan > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#96682) next »