Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8551333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:10:25+00:00 2026-06-11T14:10:25+00:00

I am trying to parse a rss-feed with php but it gives me nothing.

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:10:26+00:00Added an answer on June 11, 2026 at 2:10 pm

    As mentioned in the other answers, you’re doing a couple of things wrong, such as trying to echo arrays and objects. For some reason you’re not getting any results in $arrFeeds either, although you should.

    A simpler way to do this is change the render method of the feed to JSON: http://pipes.yahoo.com/pipes/pipe.run?_id=566903fd393811762dc74aadc701badd&_render=json

    Then you can use json_decode() to get an array of all items:

    $contents = json_decode(file_get_contents('http://pipes.yahoo.com/pipes/pipe.run?_id=566903fd393811762dc74aadc701badd&_render=json'));
    foreach($contents['items'] as $item) {
      // use $item['title'], $item['description'] etc... 
    }
    

    Note you can only echo strings, ints, etc. not structured data such as arrays or objects.

    To make it easier, you can open that URL in your browser and analyze the JSON contents @ http://json.parser.online.fr/ – you’ll see how your array is structured then.

    JSON is a much easier format to work with IMO.

    Edit:

    Since file_get_contents() is disabled you can use cURL (which should be installed on most servers, especially with allow_url_fopen disabled):

    function file_get_contents_curl($url) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
        curl_setopt($ch, CURLOPT_URL, $url);
        $data = curl_exec($ch);
        curl_close($ch);
    
        return $data;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a rss feed. I can get the elements out, but
I'm trying to parse an rss feed. I can parse the BBC's feed ok.
I I am trying to parse the entire article from an RSS feed but
Iam trying to parse rss feed from particular url... here is my php file
I'm trying to parse XML file (RSS Feed), but I have a problem that
I'm new to rss feeds and php pagination. I'm trying to parse rss feed
Am trying to parse the RSS feed from www.ted.com/talks/rss, I can access all normal
Trying to parse an iTunes Atom feed with a PHP script. If you visit
I am trying to parse an rss feed that is using the well formed
I am trying to parse iTunes top movies (top songs, albums etc) RSS feed,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.