We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

nicolaspar on 05/30/07


Tagged

file debug error save log archivo guardar


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

vali29


PHP - Debug in File


Published in: PHP 


  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 

You need to login to post a comment.