title: covert a result array in a cvs file
body: <p>How can i convert a result array into a CSV file.</p>
  
  <p>Suppose i search for something and i get the result like so --</p>
  
  <pre><code>Array
      (
  [1] =&gt; Array
      (
          [id] =&gt; 11
          [category] =&gt; phone cases
          [sale_price] =&gt; 90,99
          [price] =&gt; 120
          [product_name] =&gt; "iphone 6 plus" case transparent
      )
  
  [2] =&gt; Array
      (
          [id] =&gt; 13
          [category] =&gt; shoes
          [sale_price] =&gt; 180,99
          [price] =&gt; 200
          [product_name] =&gt; blue platform shoes
          )
  
  [3] =&gt; Array
      (
          [id] =&gt; 14
          [category] =&gt; wallet
          [sale_price] =&gt; 150
          [price] =&gt; 250
          [product_name] =&gt; velvet wallet
  </code></pre>
  
  <p>i have tried like so ---</p>
  
  <pre><code>$csvFile = fopen('/path/to/csvFile.csv', 'w+');
  fputcsv($csvFile, $array);
  </code></pre>
  
  <p>but always get the error --</p>
  
  <blockquote>
    <p>Notice: Array to string conversion (500 Internal Server Error)</p>
  </blockquote>
  
  <p>Now how can i convert this result into a CSV file !
  Any one knows any simple solution for this problem !</p>