I have an issue, my application works as follows.
First echo to the user that the generating of the csv file has started.
eg. echo 'Building of csv file started';
then I build the csv file.
Now I want to force the file to download, and this works perfectly.
this is my code
header('Content-Type: application/csv');
header('Content-Disposition:attachment;filename='.$year.'_'.$month.'_'.'export.csv');
header('Pragma: no-cache');
echo readfile($myFile);
No the first echo 'Building of csv file started' gets included in the CSV file and I do not know how to exlude it.