Constructing an array with a key from an Input array
<p>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.</p>

<pre><code>Ex: Input Array (PID, Email, Client)
--------------------------------------
Array ( 
[0] =&gt; 10, abc@test.com,Gmail 
[1] =&gt; 11, def@test.com,Gmail
[2] =&gt; 12, abc@test.com,Gmail 
[3] =&gt; 13, def@test.com,Gmail
[4] =&gt; 14, xyz@test.com,Gmail 
[5] =&gt; 15, def@test.com,Gmail
)


Ex: Output Array (with Email as the key):
---------------------------------------------
Array (
[abc@test.com] =&gt; (
                   [0] =&gt; 10
               [1] =&gt; 12
          ),
[def@test.com] =&gt; (
               [0] =&gt; 11
               [1] =&gt; 13
               [2] =&gt; 15
          ),
[xyz@test.com] =&gt; (
               [0] =&gt; 14
          )
)
</code></pre>

<p>Thanks</p>
