$column = str_replace(',',' ', $rows[address]);
$column = addslashes($column);
$column = str_replace("\n", " ",$column);
$contents.= $column."\t";
$contents.="\n";
}
header("Content-type: application/ms-excel");
header("Content-Disposition: attachment; filename=Confirmed.xls");
print $contents;
How to put address field without replacing “/n”, since it’s a address field I want to show it in cell in a good way…replacing “returns” make my address in single line.
Creating spreadsheets can get tricky with many issues, when I encountered such problem I ended up splitting the address field into multiple columns. I wrote an article about this long time ago hope this helps http://www.anchorx.com/ali/2011/02/27/create-spreadsheet-with-php/