有一个RSS提要:
www.domain1.com/rss.xsl
我需要将这个xsl feed复制到另一个webhost来制作
www.domain2.com/rsscopy.xsl
我该怎么做?我可以通过PHP做到吗?
谢谢:)
答案 0 :(得分:0)
您需要使用file_get_contents
和file_put_contents
功能。
<?php
$rss = file_get_contents('http://www.domain1.com/rss.xsl');
$filename = 'rssCopy.xsl';
$saveRss = file_put_contents($filename, $rss);
if($saveRss)
{
echo 'RSS Copied';
}
将上述脚本保存在domain2.com
中,然后通过网址进行调用。