Created
October 4, 2017 05:13
-
-
Save dertajora/bb190a7ec1f0f6c8d5a9e7f7b3d96b6d to your computer and use it in GitHub Desktop.
Manual logging using txt file in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
$file = fopen('log_script.txt', 'a'); | |
fwrite($file, $error. "\n"); | |
fclose($file); | |
#2 | |
$file_log = 'log_script.txt'; | |
file_put_contents($file_log, $error."\n", FILE_APPEND | LOCK_EX); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment