Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:50:49+00:00 2026-05-27T04:50:49+00:00

I am trying to extact the IMG SRC value out of the below RSS

  • 0

I am trying to extact the IMG SRC value out of the below RSS feed (only partial feed below).

I am currently using XML parser to get the rest of the items – which works fine (e.g.):

foreach($xml['RSS']['CHANNEL']['ITEM'] as $item) 
{
...

            $title = $item['TITLE'];
            $description = $item['DESCRIPTION'];
            $link = $item['LINK'];
        $desc_imgsrc = <how do i get this for below RSS feed??>;
...
}

However – how do i get the IMG SRC value from below RSS feed into a PHP variable? Specifically i am trying to extact “http://thumbnails.&#8212;.com/VCPS/sm.jpg” string into $desc_imgsrc variable above? How can i adapt above code to do that? Thanks.

<item>
<title>Electric Cars - all about them</title>
<metadata:title xmlns:metadata="http://search.--.com/rss/2.0/Metadata">This is the title metadata</metadata:title>
<description>This is the description</description>
<metadata:description xmlns:metadata="http://search.---.com/rss/2.0/>
<![CDATA[<div class="rss_image" style="float:left;padding-right:10px;"><img border="0" vspace="0" hspace="0" width="10" src="http://thumbnails.---.com/VCPS/sm.jpg"></div><div class="rss_abstract" style="font:Arial 12px;width:100%;float:left;clear:both">This is the description</div>]]></metadata:description>
<pubDate>Fri, 25 Nov 2011 07:00 GMT</pubDate>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:50:50+00:00Added an answer on May 27, 2026 at 4:50 am

    This is HTML (XML) inside an XML CDATA element. CDATA (character data) is not parsed by the XML parser. You need to extract the value the same way you did with the other elements. Then you can parse the element value, either by using a regular expression or even better use an XML parser again (if the HTML data is valid XML).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extract src value from image tag using prag_match with perl pattern.
im trying to extract some files from a jar-file downloaded using java-webstart. below code
I am trying to set source for Img tag using Javascript at button click.
I am trying to extract a URL from <description> <![CDATA[ <img src=http://www.jawharafm.net/Galerie/admin/?public&action=photo_large&key=RuQhuDKGNA52 alt= />
I'm trying to parse an rss feed. I can parse the BBC's feed ok.
I'm trying to make this: <span class=introduction> <img alt=image src=/picture.jpg /> </span> transform into
I am trying to extract the src value from a tag, so far I
Possible Duplicate: How to extract img src, title and alt from html using php?
I am trying to extract a link using xpath from the below mentioned url
I'm working in C#. I'm trying to extract the first instance of img tag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.