开发者

Loading multiple feeds at the same time with simplexml?

I have multiple feeds, how do i load them at the same time with simplexml

http://www.site1.com/feed
http://www.site2.com/feed
http://www.site3.com/feed
...
http://www.site20.com/feed


$xml = simplexml_load_file(开发者_运维技巧$feed);


If you want to load multiple things in PHP you have to create a loop.

Example:

<?php
$feeds = ('http://www.site1.com/feed', 'http://www.site2.com/feed', '..');

foreach($feeds as $feed)
{
  $xml = simplexml_load_file($feed);
}
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜