$str="我是日志内容!";
$str=$str.date("Y-m-d H:i:s",time())."rn";
file_put_contents('log.txt',$str,FILE_APPEND);
file_put_contents($file, $ip,FILE_APPEND|LOCK_EX);
file_put_contents() 的行为实际上等于依次调用 fopen(),fwrite() 以及 fclose() 功能一样。
FILE_APPEND:在文件末尾以追加的方式写入数据
参数说明:

© 版权声明
THE END
暂无评论内容