clankill3r Posted May 1, 2012 Share Posted May 1, 2012 I try to get the content from http://www.adafruit.com/blog/feed/ some stuff is like this: <![CDATA[ Super simple drawdio + glove @ Studio Contrechoc. we experimented with a simplified drawdio, then we combined this bit of electronics with a first glove the cyclist glove. To make this terribly designed monster more fashionable, by-wire.net made another fine glove. We had to find the right kind of small speaker, and we used a [...] ]]> no idea if that matters. Atm i have this: $xml = getFileContents("http://www.adafruit.com/blog/feed/"); $xmlTree = new SimpleXMLElement($xml); //foreach() //print_r2($xmlTree); for($i = count($xmlTree->channel->item)-1; $i >= 0; $i--) { $item = $xmlTree->channel->item[$i]; print_r2($item); //print_r2($item->category); //$category = $item->category; //print_r2($category); } it prints stuff like: SimpleXMLElement Object ( [title] => New videos – Customer service, shipping, order status and more… [link] => http://www.adafruit.com/blog/2012/04/27/new-videos-customer-service-shipping-order-status-and-more/ [comments] => http://www.adafruit.com/blog/2012/04/27/new-videos-customer-service-shipping-order-status-and-more/#comments [pubDate] => Fri, 27 Apr 2012 17:00:00 +0000 [category] => SimpleXMLElement Object ( ) [guid] => http://www.adafruit.com/blog/?p=30479 [description] => SimpleXMLElement Object ( ) ) category and description are empty, how can i get that content? print_r2 is just this: function print_r2($val){ echo "<pre>"; print_r($val); echo "</pre>"; } Quote Link to comment https://forums.phpfreaks.com/topic/261892-get-content-from-rss-feed/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.