Scheduling php scripts

前端 未结 3 2099
抹茶落季
抹茶落季 2020-12-18 10:47

I want to create some function to schedule php scripts,for example if i want tu run page.php at 12/12/2012 12:12 i can call

schedule_script(\'12/12/2012 12:1         


        
3条回答
  •  -上瘾入骨i
    2020-12-18 11:27

    $amt_time = "1";
    $incr_time = "day";
    $date = "";
    $now=  ''. date('Y-m-d') ."";   
    if (($amt_time!=='0') && ($incr_time!=='0')) {
    $date = strtotime(date("Y-m-d".strtotime($date))."+$amt_time $incr_time");
    $startdate=''.date('Y-m-d',$date) ."";
    } else {
    $startdate="0000-00-00";
    }
    if ($now == $startdate) {
    include ('file.php');
    }
    

    Just a guess ;) Actually I might have it in reverse but you get the idea

提交回复
热议问题