Re: Double Array or Dual Array...
| From: | Scott Fletcher | Date: | Fri, 25 Apr 2003 14:09:51 +0000 |
| Subject: | Re: Double Array or Dual Array... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145260@lists.php.net to get a copy of this message | ||
After some exhausting search using Google, I found a script that will work.
Here is what it look like...
--clip--
var team;
team = new Array(
//x = 0;
new Array(
new Array("Saku Koivu", 39482304),
new Array("Martin Rucinsky", 34802389),
new Array("Jeff Hackett", 39823498),
new Array("Sheldon Sourray", 87587343),
new Array("Richard Zednik", 68798735),
new Array("Brian Savage", 98098509),
new Array("Stephane Robidas", 49490583),
new Array("Patrice Brisebois", 32898334),
new Array("Oleg Petrov", 92340934),
new Array("Chad Kilger", 34923409),
new Array("Benoit Brunet", 59384093),
new Array("Jan Bulis", 83948023),
new Array("Patrick Traverse", 41239812),
new Array("Jose Theodore", 98402398),
new Array("Craig Darby", 82393434),
new Array("Patric Poulin", 34290348),
new Array("Karl Dykhuis", 89092834)
),
//x = 1;
new Array(
new Array("Mario Lemieux", 23840238),
new Array("Jaromir Jagr", 92390484),
new Array("Robert Lang", 29048203),
new Array("Alexei Kovalev", 94098230),
new Array("Jean-Sebastien Aubin", 39234923),
new Array("Kevin Stevens", 29345423)
),
//x = 2;
new Array(
new Array("Alexei Yashin", 20394802),
new Array("Daniel Alfredson", 34982039),
new Array("Marian Hossa", 92348902),
new Array("Patrick Lalime", 98203894),
new Array("Radek Bonk", 98234902)
)
);
//To see the result, just use the x and y as a make believe x-y
coordination...
//The data like 'Radek Bonk' is from y=0 while '98234902' is y=1....
x=1
y=0
team[x][y]
--clip--
I think this will work, will have to experiment with it and try it out....
"Marek Kilimajer" <kilimajer@webglobe.sk> wrote in message
news:3EA93C38.90907@webglobe.sk...
> darray = new Array();
> darray[1]= new Array(); ....
>
> Scott Fletcher wrote:
>
> >Hi!
> >
> > Excuse me if I seem to be a bit stumped. In PHP we can use dual
array
> >or double array, like this... "$array[3][2]" or something like that.
But
> >the question is, how to do that in Javascript? Because PHP declare the
> >variable and arrays automatically. With Javascript, it is manually which
is
> >not a problemf for me. Yet, I still haven't figure out how to make it
work
> >like that in Javascript.
> >
> >Thanks,
> > FletchSOD
> >
> >
> >
> >
> >
>