I'm using http headers declaring that content, then I am using the PHP function fputcsv to output data:
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=organisation.csv");
header("Cache-Control: must-revalidate");
header("Pragma: must-revalidate");
header('Expires: 0');
header('X-Content-Type-Options: nosniff');
$file = fopen('php://output', 'w');
fputcsv($file, array('Post ID', 'Post title', 'URL'));
When I run this is exporting data correctly. However I would like to split the data into different sheets/tabs within the csv.
Is this at all possible?