Skip to content

Instantly share code, notes, and snippets.

@dertajora
Created October 4, 2017 05:13
Manual logging using txt file in PHP
#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