foochuck Posted December 18, 2009 Share Posted December 18, 2009 I'm using the function 'simplexml_load_file' Here is the code I'm using: <?php $featuredImgs = "http://foochuck.com/pixelpost/index.php?x=rss"; $xml = simplexml_load_file($featuredImgs); if (count($xml->image) > 0) { foreach ($xml->image as $node) { echo "<li><a rel=\"shadowbox;\" title=\"" . $node->title . "\" href=\"" . $node->description . "\" border=\"0\" alt=\"" . $node->title . "\"></a></li>\n"; } } ?> However this PHP code returns nothing. I'm wondering if I can't interpret $featuredImgs since that file is not an XML file, but rather a PHP file pulling in a variable. Is that correct & if so, is there a work around? If that's wrong, what am I doing wrong? I'm just trying to create an unordered list of items from the xml feed object. -foochuck Link to comment https://forums.phpfreaks.com/topic/185545-interpreting-xml-into-an-object-question/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.