Page 1 of 1

Quick Array help question

Posted: Tue Jul 23, 2002 10:03 am
by toppac
This a dumb question but I am really tired and not thinking straight. How do I make a 2 dimensional array, where the columns are referenced by name and the rows are referenced by number. something like

Name--Date--Age--City
1
2
3

I cant remember how to do it. Maybe after lunch I will :wink:

Posted: Tue Jul 23, 2002 10:12 am
by llimllib
You don't need to use nested array() statements (though you could). The easiest way is just to initialize the elements as you want:

Code: Select all

$arrayї1]ї'name'] = 'John';
$arrayї1]ї'date'] = '9.19.82';
$arrayї1]ї'city'] = 'Dublin';
$arrayї2]ї'name'] = 'Steve';
$arrayї2]ї'date'] = '10.12.92';
and so on