标签:
function logger($msg){ $log = sprintf("[%s] -*- %s \n", date(‘r‘), var_export($msg, false)); $logfile = ‘../files/temp/log.txt‘; $dir = dirname($logfile); if (!is_dir($dir) && !mkdir($dir)) { return; } if (($fp = fopen($logfile, ‘a‘))) { fwrite($fp, $log); fclose($fp); } }
标签:
原文地址:http://www.cnblogs.com/liaolongjun/p/4502933.html