开发者

Loading multiple feeds at the same time with simplexml?

开发者 https://www.devze.com 2023-01-26 18:09 出处:网络
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

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

精彩评论

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