Hello everyone, and thank you to all who have helped me get this far! 🙂
Short version of my problem:
How do I clear an array that uses string keys, or a combo of string and numeric keys without having to list each array element individually?
Long version of my problem:
I have two arrays (gen_array[][], gen2_array[]), both in a loop, one setup to use string keys the other a combo of string/numeric keys. My first time through the loop, the data printed from the arrays is exactly as it should be. The second time through the loop, I get garbage: mis-matched array elements (as one of these arrays references the other) and duplicates of items already processed.
I figured out that this is due to not clearing out the array (or so I think.) So I searched the manual and found unset().
Unset works but seems to leave the keys in the array (releaving me of the "duplicates" problem, but not of the mismatched arrays issue), as my second list doesn't start until after the last element created from the first time through the loop, i.e. a sample list:
1st time thru loop -
element 1: value 1
element 2: value 2
element 3: value 3
2nd time thru loop -
element 1:
element 2:
element 3:
element 4: value 1
element 5: value 2
How can I clear out my arrays for use again?
Thanks!