标签:
function write_log($msg,$isEcho=false,$path=‘‘){ $path?‘‘:$path=‘logs‘.DIRECTORY_SEPARATOR.‘log‘.date(‘Ymd‘,time()).‘.txt‘; if(!is_dir(dirname($path))){ mkdir(dirname($path),0755,true)or die(‘创建目录失败.‘); } $msg=date(‘Y-m-d H:i:s‘,time())."---------------$msg----\n"; file_put_contents($path,$msg,FILE_APPEND); if($isEcho){ echo $msg.‘<br/>‘; } }
标签:
原文地址:http://www.cnblogs.com/zhudongchang/p/4427675.html