title: Multidimensional array sorting procedure for csv files
body: <p>There is an array, in PHP. It is setup like so</p>
  
  <pre><code>$array_var = array(array(1,2,3,4), array(5,6,7,8), array(3,5,3,9));
  </code></pre>
  
  <p>This array is from a csv file obtained using the fgetcsv function. If I was to echo out the array properly to display its contents I would make it so it shows like this:</p>
  
  <pre><code>field1  field2  field3  field4
    1       2       3       4
    5       6       7       8
    3       5       3       9
  </code></pre>
  
  <p>etc etc..</p>
  
  <p>Now I want to sort this array. But I want to sort only one of the columns in all of the arrays. Put another way, and for example, I want to take every third value in every array inside the main array and list them ascendingly, alphabetically. So for a specific case, we would take every value in field3, from the above table, and sort it. And also make it so that the end result of the sort will rearrange the columns so that they are correctly lined up with their values.</p>
  
  <p><strong>End result</strong></p>
  
  <pre><code>field1  field2  field3  field4
    1       2       3       4
    3       5       3       9
    5       6       7       8
  </code></pre>
  
  <p>etc etc..</p>
  
  <p>How can this be accomplished?</p>
  
  <p>The reason for the challenge is I am trying to remove duplicates from a single column in a csv file. I think the fastest way to do it is to sort the values and look for matches in range.</p>