天天看点

文件操作

public function logIn($msg){
        $fp = fopen($this->file,"a+");
        flock($fp, LOCK_EX) ;   //锁定文件
        fwrite($fp,"执行日期:".date("Y-m-d H:i:s",time())."\n".$msg."\n\n");
        flock($fp, LOCK_UN);  //释放文件
        fclose($fp);
}