$time_star = microtime(true);
//sleep(5);
$time_end = microtime(true);
$time_long = $time_end - $time_star;
$path="C:\Users\Administrator\Desktop\\404\log\\".date('Y_m',time())."_getoc.log";
$log = "\n[".date('Y-m-d H:i:s')."] GET_OC_LongTime: $time_long s";
//$path = str_replace('\\', '/',$path);
if(!file_exists($path)){
fopen($path, "a") or die("Unable to open file!");
}
file_put_contents($path, $log, FILE_APPEND | LOCK_EX);
php指定目录位置,创建文件,写入日志
最新推荐文章于 2024-04-15 05:00:00 发布