初学,写一个函数用于存储日志调试。
1 function WriteLog($msg) 2 { 3 $filename = dirname(__FILE__) ."\\Debug.log"; 4 $handler = null; 5 6 if (($handler = fopen($filename, ‘ab+‘)) !== false) 7 { 8 fwrite($handler, ‘[‘.date(‘Y-m-d H:i:s‘).‘]‘."\t".$msg."\n"); 9 fclose($handler); 10 } 11 }
时间: 2024-12-23 12:17:51