Jump to content

Converting RSS feed into PHP?


topflight

Recommended Posts

<?php
function getFile($url) {
		$c = curl_init($url);
		curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($c, CURLOPT_HEADER, 0);
		$res = curl_exec($c);
		curl_close($c);
		return $res;
}
$i = getFile("http://www.flightstats.com/go/rss/airportdelays.do");
$xml = simplexml_load_string($i);
foreach ($xml->channel->item as $k => $v) {
	print_r($v);
}
?>

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.