...

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



lse123
12-20-2008, 10:14 AM
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) ?

KeithLawless
12-24-2008, 05:33 PM
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

lse123
12-26-2008, 11:05 AM
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 ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum