xml parsing with php

Discussion in 'PHP' started by mdrobiul, Jul 8, 2009.

  1. #1
    mdrobiul, Jul 8, 2009 IP
  2. anthonywebs

    anthonywebs Banned

    Messages:
    657
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    are they both rss feeds?
     
    anthonywebs, Jul 8, 2009 IP
  3. myhart

    myhart Peon

    Messages:
    228
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hopefully this link will help answer you question about RSS and XML?

    http://www.webmasterworld.com/forum98/80.htm

    Parsing XML is pretty easy with PHP5 using simplexml_load_file().

    <?
    $xml = simplexml_load_file('http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&query=madonna');
    
    foreach ($xml->Result as $Result) {
    $Title = $Result->Title;
    $Summary = $Result->Summary;
    
    echo "<b>".$Title."</b><br>";
    echo $Summary."<p>";
    }
    
    ?>
    Code (markup):
     
    myhart, Jul 9, 2009 IP
  4. mdrobiul

    mdrobiul Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks. actually I had a php class which is common in parsing most of RSS like google news or some others AND IT worked fine. I thought this class file will be able to do RSSFEEDS syndication for any xml file. I just came to know that actually, first i have to look into xml elements and child elements of the xml source for coding RSS feeds.
     
    mdrobiul, Jul 10, 2009 IP