日志测试法

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

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

原文地址:https://www.cnblogs.com/jiqing9006/p/5843434.html