[英]file_put_contents in php
I just tried to use this file_put_contents
. 我只是尝试使用此
file_put_contents
。 The code is: 代码是:
$file = 'list.txt';
$subject = "Mail Subject\n";
file_put_contents($file, $subject);
But it doesn't put any contents. 但是它没有放置任何内容。
file_get_contents
is working though. file_get_contents
正在运行。
Update: Problem solved. 更新:问题已解决。 I'm not sure.
我不确定。 I just changed chmod to 777. But I have a doubt.
我只是将chmod更改为777。但是我对此表示怀疑。 I am checking the log error.
我正在检查日志错误。
Things to check: 检查事项:
file_put_contents
returns the number of bytes written or false on error. file_put_contents
返回写入的字节数或错误时为假的字节数。 Save the return value to a variable and see what you get back.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.