如何每天更新一次


How to update once a day

我希望example_homepage.html每天更新一次,如何更新?

    <?php
$ch = curl_init("http://rss.news.yahoo.com/rss/oddlyenough");
$fp = fopen("example_homepage.html", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$xml = simplexml_load_file('example_homepage.html');
print "<ul>'n";
foreach ($xml->channel->item as $item){
  print "<li>$item->title</li>'n";
}
print "</ul>";
?>

你知道我的意思吗?这个页面非常慢,所以我希望example_homepage.html每天更新一次。但是我不知道该怎么办?

您可以在Linux环境中使用cron选项卡了解更多信息https://help.ubuntu.com/community/CronHowto

或者您可以使用第三方cron服务喜欢http://cronless.com/