I have PHP string that is saved to a CSV file. Content of the string is splited by \t character. Tab separation is correctly saved, but if I open file in Excel, all of the content is placed (showed) in same cell.
Can you help me how to have file correctly showed by Excel also.
Will it be with some different headers of something like that?
$result = '';
$result .= "\n";
$result .= 'COL1';
$result .= "\t";
$result .= 'COL2';
$result .= "\t";
$result .= 'COL3';
$result .= "\n";
echo $result;
header("Content-type: application/vnd.ms-excel; charset=utf-8");
header('Content-Disposition: attachment; filename="opendata.csv"');
Thank you in advance!