时间:2021-07-01 10:21:17 帮助过:18人阅读
require (dirname(__FILE__) . "/../conn.php"); mysql_select_db("news",$conn_database); mysql_query("delete from web_news where news_date<(date(now())-60*60*24*30)"); mysql_close($conn_database); if ($handle = opendir(dirname(__FILE__).'/../cache/')) { while (false !== ($file = readdir($handle))) { if ((time()-filectime(dirname(__FILE__).'/../cache/'.$file)) < 60*60*24*30) { if (strripos($file, '.html') !== false) { unlink(dirname(__FILE__).'/../cache/'.$file); } } } }