quocvuongdn

#php: write log to file txt

Jul 14th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1. private function wlog($str, $file_name){
  2.         $file = isset($file_name) ? $file_name : 'default_log.txt';
  3.         $current    = $str . PHP_EOL;
  4.         // Write the contents to the file
  5.         $f = fopen($file, 'a');
  6.         fwrite($f, $current);
  7.         fclose($f);
  8.     }
Advertisement
Add Comment
Please, Sign In to add comment