Simple Log writing function implemented by php, php log function _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.