I have an array that has a list of PID, Email and Client in a comma delimited array. I was wondering if there's a way to parse the input array and generate a new array that has "Email" as the key and all unique PIDs for that email. Since the input array can have thousands of elements, I was wondering about the fastest approach.
Ex: Input Array (PID, Email, Client)
--------------------------------------
Array (
[0] => 10, [email protected],Gmail
[1] => 11, [email protected],Gmail
[2] => 12, [email protected],Gmail
[3] => 13, [email protected],Gmail
[4] => 14, [email protected],Gmail
[5] => 15, [email protected],Gmail
)
Ex: Output Array (with Email as the key):
---------------------------------------------
Array (
[[email protected]] => (
[0] => 10
[1] => 12
),
[[email protected]] => (
[0] => 11
[1] => 13
[2] => 15
),
[[email protected]] => (
[0] => 14
)
)
Thanks
fgets()on a CSV file?