title: How to create an empty csv file in php?
body: <p>I have tried creating creating but I do not know how to download. How do I create an empty CSV file that can be viewed on the web page, manipulated and downloaded in php?</p>
  
  <pre><code> &lt;?php
               $new_csv= fopen('/scoresheet.csv' , 'w');
               fputcsv($new_csv, $row);
               fclose($new_csv);
  
               header("content-type:text/csv");
               header("content-disposition:attachment; filename=scoresheet.csv");
               readfile("/scoresheet.csv");
              ?&gt;
              &lt;a href='excel.php?request=".$id."' class='btn btn-primary'&gt;Download&lt;/a&gt;
  </code></pre>