2014-11-04 52 views
-1

我正在使用以下代码从网站获取一些信息并将其保存到本地。在php中运行重复的任务

$ch = curl_init("http://test.com/test.txt"); 
$fp = fopen("test.txt", "w"); 

curl_setopt($ch, CURLOPT_FILE, $fp); 
curl_setopt($ch, CURLOPT_HEADER, 0); 

curl_exec($ch); 
curl_close($ch); 
fclose($fp); 

现在test.txt需要定期更新。我如何在特定的时间间隔触发此操作?

+6

使用cron我的儿子 – 2014-11-04 04:06:04

回答