I've been trying to tighten up some data structures in a newsletter-mailing application, and desperately need some help.
Here's my problem: I have a list of ~2,000 email addresses from subscribers in a flat file on disk. Due to the newsletter being personalized per domain, I'd like to read the entire file into a structure like this:
aol.com->[sherrij, foobar]
mindspring.net->[tom111, t23s,13223]
lycos.com->[dog,cat,tree]
where the index (key?) of the array is the domain, and it points to another array of actual user names.
my thought process is that i could use array_key_exists to search the array for an existing domain; if it exists, i'll then push it onto the array the domain points to.
does anyone have any recommendations on the best way to approach this? i have a pure C background, and associative arrays are very new to me. i'm currently RTFM, but any code snippets would be greatly appreciated
Thanks!!!