php 写内容到文件,把日志写到log文件 Posted on 2016年11月24日2018年4月17日 by yangxing 简单三行代码,放到你要输出的位置,一般生成的log文件会在根目录或者该文件的目录下。 123 $file = 'log.txt'; $content = "第一次写入n"; file_put_contents($file, $content,FILE_APPEND);