title: How to display line by line a csv file in PHP with a particular structure?
body: <p>I have this code that reads a csv file and displays it in this form :</p>
  
  <pre><code>REFERENCE;COLOR;QUANTITY;TURNOVER;SELL TROUGH;COMMENT 
  GJK0C9;8952;3;90;3%;Pack S   
  GJKCS4;399;2;19;10%;Windows    
  GSIJS5;9224;18;128;12%;New co   
  BBBOF1;90;17;116;13%;In sales    
  ...
  </code></pre>
  
  <p>First the header and then all the lines.</p>
  
  <p>I would like to display like this:</p>
  
  <pre><code>REFERENCE : GJK0C9    
  COLOR: 8952    
  QUANTITY: 3    
  TURNOVER : 90    
  SELL TROUGH: 3%   
  HOW: Pack S  
  
  REFERENCE : GJKCS4    
  COLOR: 399    
  ....
  </code></pre>
  
  <p>And so on.</p>
  
  <p>How to display the result with this format?</p>
  
  <pre><code>&lt;?php
  $row = 1;
  if (($handle = fopen($nomcsv, 'r')) !== FALSE)
  {
      echo '&lt;table&gt;';
  
      // Get headers
      if (($data = fgetcsv($handle, 1000, ',')) !== FALSE)
      {
          echo '&lt;tr&gt;&lt;th&gt;'.implode('&lt;/th&gt;&lt;th&gt;', $data).'&lt;/th&gt;&lt;/tr&gt;';
      }
  
      // Get the rest
      while (($data = fgetcsv($handle, 1000, ',')) !== FALSE)
      {
          echo '&lt;tr&gt;&lt;td&gt;'.implode('&lt;/td&gt;&lt;td&gt;', $data).'&lt;/td&gt;&lt;/tr&gt;';
      }
      fclose($handle);
      echo '&lt;/table&gt;';
  }
  
  
  ?&gt;
  </code></pre>