解决方案 »

  1.   

    用 file_get_contents 读取远程 xml
    用 file_put_contents 保存 xml 到本地
      

  2.   

    下载下来,怎样设定他一天更新一次啊$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>";