php实现的简单日志写入函数 本文实例讲述了php实现的简单日志写入函数。分享给大家供大家参考。具体实现方法如下:
1
2
3
4
5
6
7
8
9
function log( $logthis ){
file_put_contents('logfile.log', date(y-m-d h:i:s). . $logthis. \r\n, file_append | lock_ex);
}
// use \r\n for new line on windows, just \n on linux
// php_eol cross platform solution for new line
// // so better to use this
function log( $logthis ){
file_put_contents('logfile.log', date(y-m-d h:i:s). . $logthis.php_eol, file_append | lock_ex);
}
http://www.bkjia.com/phpjc/977160.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/977160.htmltecharticlephp实现的简单日志写入函数 本文实例讲述了php实现的简单日志写入函数。分享给大家供大家参考。具体实现方法如下: 1 2 3 4 5 6 7 8 9 func...
