Equivalent of MySQL SELECT DISTINCT on data stored in CSV file
<p>So I have a list of records similar to the below, stored in a tab-separated file.</p>

<pre><code>AgentID Date
HA  13-09-2012
BC  13-09-2012
DE  13-09-2012
BC  14-09-2012
AB  14-09-2012
AB  15-09-2012
HA  15-09-2012
BC  18-09-2012
BC  19-09-2012
</code></pre>

<p>I want to show the last updated date for each userID and echo this to screen. So for the above example, the output would be</p>

<pre><code>AgentID Date
DE  13-09-2012
AB  15-09-2012
HA  15-09-2012
BC  19-09-2012
</code></pre>

<p>What is the most efficient way to do this using PHP? I am thinking I need to read the results into an array and sort the array by date - I can't figure out how to remove the array entries that I don't want.</p>

<p>There are multiple AgentID's in my real file and the dates go over months and will change multiple times a day (obviously inserting the AgentID and the days date). There are also additional columns which I would want to include in the output but not consider when manipulating the data.</p>

<p>Thanks in advance</p>
