Jump to content

[SOLVED] foreach && ?


busillis

Recommended Posts

Thanks

 


<?php
$html = file_get_contents("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml");
$xml = new SimpleXMLElement($html);
$count = 0;
foreach ($xml->xpath('//item/title|//item/link') as $node) {
	echo $node, '<br>';
	if ($count && $count % 2) {
		echo '<hr>';
	}
	++$count;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.