tjyoung
asked on
How to loop through this kind of an array returned from mailchimp.
Hi,
Using the mailchimp API I'm returning the array below. It contains the email addresses and their open counts for a particular email campaign. I'm having a hard time trying to loop through it so I can insert each email and corresponding open count into my db. Can someone show me an example of looping through this thing to do an insert?
Thanks as always,
tj
Using the mailchimp API I'm returning the array below. It contains the email addresses and their open counts for a particular email campaign. I'm having a hard time trying to loop through it so I can insert each email and corresponding open count into my db. Can someone show me an example of looping through this thing to do an insert?
array(2) { [0]=> array(2) { ["email"]=> string(24) "john@mysite.com" ["open_count"]=> int(1) } [1]=> array(2) { ["email"]=> string(23) "bill@mydomain.com" ["open_count"]=> int(3) } }
Thanks as always,
tj
ASKER
Hi,
I've tried hundred variations only getting stuff like: arrayarray and a myriad of other mistakes. I'd post my attempts but none of them seemed close or simply failed.
cleaning up the arrays I appreciate, should've done that posting my question.
Can you give me an example of iterating through this? I can figure out adding to a DB I should think but I can't for the life of me get to the correct data.
Its a bit of a grey area in my 'home schooling' efforts.
I've tried hundred variations only getting stuff like: arrayarray and a myriad of other mistakes. I'd post my attempts but none of them seemed close or simply failed.
cleaning up the arrays I appreciate, should've done that posting my question.
Can you give me an example of iterating through this? I can figure out adding to a DB I should think but I can't for the life of me get to the correct data.
Its a bit of a grey area in my 'home schooling' efforts.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much. Makes perfect sense once you see it...
Open in new window