PHP - Debug in File


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. define('PATH', dirname(realpath(__FILE__)) );
  3. function debug($texto){
  4. file_put_contents(PATH.'/log.log',date('d/m/Y H:i:s').' - '.$texto."
  5. ",FILE_APPEND);
  6. echo date('d/m/Y H:i:s').' - '.$texto."<br>";
  7. flush();
  8. return;
  9. }
  10. #Ej
  11. debug('iniciando proceso...');
  12. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.