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 5947545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:58:44+00:00 2026-05-22T16:58:44+00:00

PHP, reading RSS Feeds. My codes works fine but NOT for all RSS links,

  • 0

PHP, reading RSS Feeds. My codes works fine but NOT for all RSS links, for example:

Error Making Links

  • http://stackoverflow.com/feeds/tag?tagnames=php&sort=newest
  • https://www.facebook.com/feeds/page.php?id=20669912712&format=rss20

Error Messages

  • Parse error: syntax error, unexpected T_VARIABLE ...
  • Warning: DOMDocument::load() [domdocument.load]: Opening and ending tag mismatch ...

These (above) RSS links are problem with various type of codes i found.
And, people saying me these links are not the “valid” formatted.
But SimplePie can read these links well.

  • Why?
  • SimplePie can read these links .. and NOT ME?

I want my codes to work well on all feeds like SimplePie.. ;(
… …

Here is brief code sample of class i’m using:

class RSSREADER {
private $xml;
private $items;
private $item;

public static function _ParseFeeds ($link)
{
    $self->xml = @simplexml_load_file($link);
    echo $self->xml->channel->title.'<br />';
    echo $self->xml->channel->description.'<br /><br />';

    $self->items = $self->xml->channel->item;
    foreach ($self->items as $self->item) {
        echo $self->item->title.'<br />';
        echo $self->item->description.'<br />';
    }
}
}
  • 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-05-22T16:58:45+00:00Added an answer on May 22, 2026 at 4:58 pm

    Plenty of RSS feeds are actually invalid; SimplePie and other parsers often go to great lengths to work around these terrible implementations, which is why it’s easier to use these libraries than to write your own. We use SimplePie and there are plenty of feeds out there that are so terrible that even SimplePie fails.

    In short; unless you like pain and/or have some terrible driving compulsion to write your own, use another library. As you’ve noticed, trying to parse them as pure XML will fail extremely often.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

from a PHP script I'm downloading a RSS feed like: $fp = fopen('http://news.google.es/news?cf=all&ned=es_ve&hl=es&output=rss','r') or
I'm reading a rss feed using simple code: <?php $homepage = file_get_contents('http://www.forbes.com/news/index.xml'); $movies =
I am reading this tutorial on fetching RSS feeds using PHP Simple XML. Reason
I was trying out this tutorial for reading rss feeds with a php file
I've been reading the PHP Docs on Type Juggling and Booleans but I still
I'm reading and store a RSS feed in my database.I'm using this code <?php
I'm new to php.I'm reading a RSS feed and store in my database table.
When reading a PHP book I wanted to try my own (continue) example. I
My local server reads the RSS fine, but when I upload it I'm getting
I've been reading php code all day and what I can't seem to find

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.