更新时间:2023-12-04 13:57:58
给我的声音就像您可能使用单引号一样,即'\n'
而不是"\n"
.
Sounds to me like you might be using single quotes, i.e. '\n'
rather than "\n"
.
如果您想继续使用单引号偏差(如您所愿!),则有两个选择:
If you wanted to continue with a single quotes bias (as you should!), two options:
file_put_contents('/path/to/file.txt', 'Hello friend!
This will appear on a new line.
As will this');
// or
file_put_contents('/path/to/file.txt', 'Hello friend!'."\n".'This will appear on a new line.'."\n".'As will this');