Created
August 25, 2017 08:34
-
-
Save alokstha1/b32035504020a7b2bac0cfc585ba6bce to your computer and use it in GitHub Desktop.
Create an exporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Encoding: Windows-1252'); | |
header('Content-Type: text/csv; charset=Windows-1252'); | |
header('Content-Disposition: attachment; filename='.$filename.'.csv' );//$filename as name of a file that will be downloaded | |
$output = fopen($filepath, 'w');//$filepath as path to the directory where the file will reside. | |
fputcsv($output, array('arrays of column header')); | |
fputcsv($output, $insert_array); | |
fclose($output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment