function log($str){
$years = date('Y-m-d');
$url = '../web/qd_log/'.$years.'_qd_log.txt';
$dir_name=dirname($url);
if(!file_exists($dir_name))
{
mkdir(iconv("UTF-8", "GBK", $dir_name),0777,true);
}
$fp = fopen($url,"a");
fwrite($fp,date("Y-m-d H:i:s").var_export($str,true)."\r\n");
fclose($fp);
}
php 写入文件 用于日志等
最新推荐文章于 2023-12-18 16:04:28 发布