One Way am creating an xls with fopen("test.xls") .
Using fwrite i write xls and readfile give me the file.
Second Way
I generating xls with putting
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header ("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header("Content-Disposition: attachment; filename=\"test.xls\"");
header("Content-Type: application/vnd.ms-excel");
foreach ()
{
echo contents to the file
}
Is there any difference between these 2 ways of generating file.
What is difference.