如何在php中写入新行


How do i write new line in php?

可能重复:
PHP-如何创建换行符?

我正在尝试创建一个csv文件。但我只得到一排。我以为

echo ''r'n' . $lineStr;

将创建一条新线路。

我添加了以下标题:

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);

您需要双引号:

"'r'n"