Advertisement
wmachuca

Create Log

Jul 21st, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. function archivo($content, $log = 'log') {
  2.     $archivo = "/ruta/" . $log . '.txt';
  3.     $fecha = date("Y/m/d h:i:s");
  4.     $buffer = $fecha . " - " . $content . "\r\n";
  5.     if (file_exists($archivo))
  6.         $abrir = @fopen($archivo, "a");
  7.     else {
  8.         $abrir = @fopen($archivo, "w+");
  9.         chmod($archivo, 0777);
  10.     }
  11.     @fwrite($abrir, $buffer);
  12.     @fclose($abrir);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement