Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If I have a rss feed in csv I may use PHP to get it , well if the feed is in xml I mu

    If I have a rss feed in csv I may use PHP to get it , well if the feed is in xml I must also use PHP ? Or may use or may do NOT use PHP ? What to use for:
    httprequest.open(...?...); // ?
    what to use in PHP file (for xml feeds non csv) ?

  • #2
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'd start with code like this:

    <code>
    <?php
    $input = file_get_contents($url) or die('Could not access file: $url');
    $xmlobj = simplexml_load_string($input);

    print_r($xmlobj);
    ?>
    </code>

    This will get the XML document at $url (the rss feed), convert it into a PHP object, and dump out the resulting object so you can see what the structure of the object looks like.

    You can use normal object notation ($xmlobj->attribute) to access parts of the rss feed object after that. Mostly these will take the form of php arrays that you can use a foreach loop to process.

    Hope this helps!
    Keith
    http://www.keithlawless.com

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You mean if I have an rss.xml doc I may or not , use a php file ? correct / no-correct
    If I use php I may use PHP arrays and If I do not use php I must use getElementById for the xml file ?
    Tell me the way if I have a doc eg rss.xml not use php to parse ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •