日志测试法

/**
 * 写入日志
 */
function write2log($content,$filename='log') {
    $myfile = fopen($filename.".txt", "a+") or die("Unable to open file!");
    $txt = date('Y-m-d H:i:s')."\t".$content."\r\n";
    fwrite($myfile, $txt);
    fclose($myfile);
}

把内容记录在日志中,进行测试~

posted @ 2016-09-05 19:55  TBHacker  阅读(485)  评论(0编辑  收藏  举报