Re: [PHP] php get rss tag using DOM
Getting RSS Feeds is going really good right now, what amazing technology :) http://www.msnnick.net Nickname Msn Morris-25 wrote: Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { // help here } -- View this message in context: http://www.nabble.com/php-get-rss-tag-using-DOM-tp21901033p25060811.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php get rss tag using DOM
Michael A. Peters wrote: Rodgerr wrote: Morris-25 wrote: Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { $node = $r-item($i); if ($node-hasAttribute('url') { $url[] = $node-getAttribute('url'); } } That should give you an array called $url of all the url attributes in the nodes. $url[] = $node-getAttribute('url'); should be $url[] = $node-getAttribute('url'); and don't forget to validate it before spitting it back out on a page somewhere ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php get rss tag using DOM
Morris-25 wrote: Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { // help here } Hi. Our site http://rssphp.blogspot.net http://rssphp.blogspot.net is working on providing possible solutions to the problem with different parsing methods in PHP. It's worth to have a look at the options. -- View this message in context: http://www.nabble.com/php-get-rss-tag-using-DOM-tp21901033p24330531.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php get rss tag using DOM
Rodgerr wrote: Morris-25 wrote: Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { $node = $r-item($i); if ($node-hasAttribute('url') { $url[] = $node-getAttribute('url'); } } That should give you an array called $url of all the url attributes in the nodes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php get rss tag using DOM
Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { // help here }