title: Grouping CSV input by columns
body: <p>I am Sharam, current exchange student in Europe from a after school club tackling politics &amp; issues concerning the youth of Southeastern Asia. In our group we have new volunteers around the world every month and we have setup central server to categorise &amp; prioritise tasks the club must have performed in the future to have meaning in our country. I have little knowledge in PHP however I am eager to learn, here is my problem...</p>
  
  <p>Because SQL it's too complex we use CSV. Everybody can edit master CSV &amp; add tasks to it like here:</p>
  
  <pre><code>Priority,Task,Person
  High,Campus flyers,Ashley
  High,Test videocall with teacher,Sharam
  Low,New Website,Martin &amp; Aneet
  Medium,Auditorium recruiting,Martin &amp; Aneet &amp; Ashley
  Low,Garbage collecting,Sharam &amp; Ashley
  High,Ask permission to reserve classroom Sat &amp; Sun,Sharam
  </code></pre>
  
  <p>As you see, priority of item is high, medium, low in any order. I tried array_merge_recursive() but maybe I am doing it wrong:</p>
  
  <pre><code>&lt;?php
  
  $file = @fopen("tasks-list.csv", "r") or exit("error, check server status");
  
  $array = array();
  $header = fgetcsv($file, 1000, ","); //don't need header in array
  
  while (!feof($file)) {
    $data = fgetcsv($file, 1000, ",");
    if (!empty($data)) {
      $array = array_merge_recursive($array, array($data[0] =&gt; $data[1], $data[2]));
    }
  }
  fclose($file);
  ?&gt;
  </code></pre>
  
  <p>Result is mixed up and I am missing how to make CSV input grouped by column like here:</p>
  
  <pre><code>High priority tasks:
  1. Campus flyers (Ashley)
  2. Test videocall with teacher (Sharam)
  3. Ask permission to reserve classroom Sat &amp; Sun (Sharam)
  
  Medium priority tasks:
  1. Auditorium recruiting (Martin &amp; Aneet &amp; Ashley)
  
  Low priority tasks:
  1. New Website (Martin &amp; Aneet)
  2. Garbage collecting (Sharam &amp; Ashley)
  </code></pre>
  
  <p>My code it's missing presentational part but it is not the difficult part. HTML is easy to me but I have problem with array grouped properly. How can I achieve it? Thank you</p>
  
  <p>Sorry about my grammars &amp; spelling, I am just learning second year of English!
  --Sharam</p>