编写php文件时,用fopen()函数打开一个txt文件,按如下方式写入字符时怎样都不能写入换行符
$outputstring = $date." ".$tireqty." tires ".$oilqty." oil ".$sparkqty." spark plugs \$".$totalamount." ".$address."\n";
fwrite($fp, $outputstring,strlen($outputstring));
经查询后知道:
在windows平台下用"\r\n",在unix平台下用"\n"。