file_put_contents, file_append and line breaks

后端 未结 7 1316
旧时难觅i
旧时难觅i 2020-12-30 19:32

I\'m writing a PHP script that adds numbers into a text file. I want to have one number on every line, like this:

1
5
8
12

If I use f

7条回答
  •  情歌与酒
    2020-12-30 20:00

    its because each time you write to the file, the file is being finished, file_put_contents inserts an extra line break at the end

提交回复
热议问题