Simple Log writing function implemented by php, and php log function. Simple Log writing function implemented by php. This document describes the simple log writing function implemented by php. Share it with you for your reference. The specific implementation method is as follows: simple log writing function implemented by func php, php log function
This example describes the simple log writing function implemented by php. Share it with you for your reference. The specific 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 \ n on linux // PHP_EOL cross platform solution for new line // so better to use 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 will help you with php programming.
Examples in this article describes the simple log writing functions implemented by php. Share it with you for your reference. The specific implementation method is as follows: func...