Skip to content

Instantly share code, notes, and snippets.

@dertajora
Created October 4, 2017 05:13
Show Gist options
  • Save dertajora/bb190a7ec1f0f6c8d5a9e7f7b3d96b6d to your computer and use it in GitHub Desktop.
Save dertajora/bb190a7ec1f0f6c8d5a9e7f7b3d96b6d to your computer and use it in GitHub Desktop.
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