2

Possible Duplicate:
PHP - how to create a newline character?

I'm trying to create a csv file. But all i get is one row. I thought

echo '\r\n' . $lineStr;

would create a new line.

I have added the following headers:

header("Content-Type:   application/vnd.ms-excel; charset=utf-8");
header("Content-Disposition: attachment; filename=myFile.xls");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
Community
  • 1
  • 1
DevNull
  • 763
  • 5
  • 17
  • 30
  • 1
    possible duplicate of [PHP - how to create a newline character?](http://stackoverflow.com/questions/4238433/php-how-to-create-a-newline-character) See also [Print newline in PHP in single quotes](http://stackoverflow.com/questions/2531969/print-newline-in-php-in-single-quotes) – Wesley Murch Sep 11 '12 at 22:32

1 Answers1

14

You need double quotes:

"\r\n"
jpic
  • 32,891
  • 5
  • 112
  • 113