Basically I want to be able to create an array where the different indexes of the array can be called easily by:
array_name[x]["index_name"] where x is a row number and index_name is the column name string.
by defining the "column name strings" just once--NOT each time I add a row to the array with array[]=...
such as this:
Column 1 is "id"
value represented by $array_people[X]["id"]
Column 2 is "name"
value represented by $array_people[X]["name"]
Column 3 is "phone"
value represented by $array_people[X]["phone"]
Column 4 is "address"
value represented by $array_people[X]["address"]
Column 5 is "zip"
value represented by $array_people[X]["zip"]
$array_people[] = array(); // maybe define column names in here somehow?
// or define columns here in another statement?
// now add rows/values to array
$array_people[] = array("1","tim","555-5555","1st st nw","12345");
$array_people[] = array("2","mark","555-5555","2nd st nw","12345");
$array_people[] = array("3","matt","555-5555","3rd st nw","12345");
...
$array_people[] = array("100000","xyz","555-5555","123rd st nw","12345");
// now get a value for row 0
echo $array_people[0]["name"]."'s phone number is ".$array_people[0]["phone"];
In summary, how do I do the array setup to easily get values using [row_number]["col_name"] without having to use the "col_name" each time I do $array_people[] = array("1",...) -- add another row to the array.
For example, I need to let php know that when a line like this is used:
$array_people[] = array("2","mark","555-5555","2nd st nw","12345");
That the first value added will ALWAYS be ["id"], the second ["name"], and so on.
Thanks for your help.