www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] PHP & XML File (RSS)

  1. #1
    Join Date
    Sep 2008
    Posts
    260

    resolved [RESOLVED] PHP & XML File (RSS)

    Hello again...

    I posted something earlier today that I'm close to resolving myself. At this point in time I only have one issue with my code (after I found multiple errors earlier).

    I'm extracting information from a WordPress XML File. I'm trying to pull an image location but although it's in the XML file, it's not being recognized as a XML file "tag" because it doesn't have a closing tag.

    XML Example:

    Code:
    <item>
    		<title>VH1′s Behind The Music: Usher</title>
    		<link>http://www.volumestat.com/2010/07/20/vh1%e2%80%b2s-behind-the-music-usher/</link>
    		<comments>http://www.volumestat.com/2010/07/20/vh1%e2%80%b2s-behind-the-music-usher/#comments</comments>
    		<pubDate>Tue, 20 Jul 2010 14:28:02 +0000</pubDate>
    
    		<dc:creator>admin</dc:creator>
    				<category><![CDATA[ATL Music]]></category>
    		<category><![CDATA[atl music]]></category>
    		<category><![CDATA[behind the music]]></category>
    		<category><![CDATA[usher]]></category>
    		<category><![CDATA[video]]></category>
    
    		<guid isPermaLink="false">http://www.volumestat.com/?p=5826</guid>
    
    		<description><![CDATA[
    			
    				
    			
    		
    
    Usher’s “Behind The Music” aired last night on VH1, where he gets personal about his relationships, marriage, what it’s like being a father, the concepts behind his albums and his brief reunion with his dad. The episode takes you from how he got discovered at talent shows, to recording his debut with Diddy, the liberation [...]]]></description>
    		<wfw:commentRss>http://www.volumestat.com/2010/07/20/vh1%e2%80%b2s-behind-the-music-usher/feed/</wfw:commentRss>
    		<slash:comments>0</slash:comments>
    	<enclosure url='http://www.volumestat.com/wp-content/uploads/2010/07/usherraymond-600x344-150x150.jpg' length ='6481'  type='image/jpg' />	
    
    </item>
    This is it in red. How can I access the "url" in this tag in an XML file, although it isn't being recognized as an actual XML tag??

    Meaning that I can't use
    PHP Code:
    foreach ($item -> enclosure as $img_tag

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346

  3. #3
    Join Date
    Sep 2008
    Posts
    260
    appreciate that very much..I'm working on your suggestion now.. thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles