title: php - How to convert 2d array into csv file with adding header
body: <p>How can i convert my 2d array into csv file with adding header so user can upload the file directly.</p>
  
  <p>Here is my array </p>
  
  <pre><code>Array (   
      [0] =&gt; Array
          (
              [0] =&gt; 25/2/2013
              [1] =&gt; 8.45 a.m
              [2] =&gt; 9.98
              [3] =&gt; 1.23
              [4] =&gt; 6.1
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; 25/2/2013
              [1] =&gt; 8.46 a.m
              [2] =&gt; 9.02
              [3] =&gt; 1.75
              [4] =&gt; 1.75
          )
   )
  </code></pre>
  
  <p>and i want my output as </p>
  
  <p>Date         Time       Value1    Value2    Value3  (all header)<p>
  25/2/2013   8.45 a.m     9.98      1.23      6.1   <p>
  25/2/2013   8.46 a.m     9.02      1.75      1.75</p>