Mini Shell

Direktori : /home/mhcadmin/www/Portal/
Upload File :
Current File : /home/mhcadmin/www/Portal/StudentSample.php

<?php

$delimiter = ",";
$filename = "Students-List_" . date('d-m-Y_H-i') . ".csv";

$f = fopen('php://memory', 'w');
$fields = array('Full_Name', 'Student_No','email','Parent_Phone');
fputcsv($f, $fields, $delimiter);

// Add one empty row as template
$lineData = array('', '', '');
fputcsv($f, $lineData, $delimiter);

rewind($f);

header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');
header('Expires: 0');

fpassthru($f);
fclose($f);
exit;


?>