php项目中常用的log日志记录方法

function log_result($str) {
if (LOG_WRITEOUT == 1) {
$fp = fopen ( "log.txt", "a+" );
fwrite ( $fp, "【日志】" . $str . "日期:" . date ( "Y-m-d H:i:s" ) . "\r\n" );
fclose ( $fp );
}
}

posted @ 2018-03-24 00:42  小海鲜  阅读(526)  评论(0编辑  收藏  举报