php 写入文本如何换行

高手们,我想请讲解下,php 写入文本如何换行
最新回答
◎黛颜

2026-10-23 00:06:18

你好,<?php
$str="sdfsd"."\r\n";
file_put_contents("test.txt",$str);
?>
这样就可以换行,linux使用"\n"就可以,windows"\r\n".