| [reply] |
Missed an important point. I need to know which list the data is coming from. More accurate result would be:
Day 1: fruit=apple veg=celery
Day 2: fruit....
| [reply] [d/l] |
Basically, you either know all the lists are the same length, or you extract the length of the longest one programmatically (you say you know how to make the data structure so I assume you know how to access it). Once you have that information, do a foreach $element_num (1..$foo) { where $foo is your number of elements in the longest list. For each number, you extract one element from each list with an internal foreach loop that uses keys to get you the individual list names. Alternately, you could make an array of arrays and just make element 0 of each row the name of that list--then it should be fairly obvious how to march across all the rows in lock-step. It depends on whether you want easy access to the data by list name.
| [reply] [d/l] [select] |
For example by iterating over the indexes of one array, and accessing the the items "simultaneously" (whatever that means if you don't use threads...) by index.
| [reply] |