PHP implementation of simple log write function, PHP log function
This article describes a simple log write function implemented by PHP. Share to everyone for your reference. The implementation method is as follows:
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 \ linux//Php_eol cross platform solution for new line////So better Thisfunction log ($logthis) {file_put_contents (' Logfile.log ', date ("Y-m-d h:i:s"). " " . $logthis. Php_eol, File_append | LOCK_EX);}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/976693.html www.bkjia.com true http://www.bkjia.com/PHPjc/976693.html techarticle PHP Implementation of a simple log write function, PHP log function in this paper, a simple example of PHP implementation of the log write function. Share to everyone for your reference. The concrete implementation method is as follows: Func ...