I am trying to parse a rss-feed with php but it gives me nothing. As you can see I am trying to echo both the $doc and the $itemRSS array and it gives me nothing and the "Success!" for when item 0 in the array is never reached.
I would be thrilled if someone could say "have you thought about [idiotic mistake]?", so please consider me a noob for this question. Thank you!
$doc = new DOMDocument();
$doc->load('http://pipes.yahoo.com/pipes/pipe.run?_id=566903fd393811762dc74aadc701badd&_render=rss');
$arrFeeds = array();
foreach ($doc->getElementsByTagName('item') as $node) {
$itemRSS = array (
'guid' => $node->getElementsByTagName('guid')->item(0)->nodeValue
);
array_push($arrFeeds, $itemRSS);
}
if ($itemRSS[0] != NULL) {
echo 'Success!';
}
echo $itemRSS;
echo $doc;
And by this I mean that the page is completely blank. No error, nothing.
Update: Apprently my webhost has allow_url_fopen deactivated, so I have to find another way to do this. sigh