title: Get associative array from csv
body: <p>I open a csv file from a url. Each line has 4 fields and each field has a name:</p>
  
  <pre><code>Field1;Field2;Field3;Field4
  </code></pre>
  
  <p>Now my script handles the csv data as one single line but I want to have it this way:</p>
  
  <pre><code>Array
  (
     [0] =&gt; array(
                    ['field1'] =&gt; 1
                    ['field2'] =&gt; 2
                    ['field3'] =&gt; 3
                    ['field4'] =&gt; 4
     )
  )
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>if (($handle = fopen ( $eurl, "r" )) !== FALSE) {
          while ( ($data = fgetcsv ( $handle, 4096, ";" )) !== FALSE ) {
          $num = count ( $data );
              for($c = 0; $c &lt; $num; $c ++) {
                  echo $data [$c];
              }
          }
      fclose ( $handle );
      }
  </code></pre>