CDATA you have is a string containing HTML. So first treat it as text, but since this text is meant to contain HTML, parse this text using solution appropriate for parsing HTML.

In other words: use appropriate tool (HTML parser) for the job (parsing HTML).

There are already existing solutions for parsing HTML in PHP - eg. see answers to this questions:


How to parse and process HTML with PHP?
Robust, Mature HTML Parser for PHP.


So, basically, you already are able to get the HTML string from your XML. Now parse the HTML and get source of the image using some of the solutions mentioned above.

Using preg_match() for parsing HTML is not a good idea, as it would need to be very complex to do a simple thing HTML parser is suitable for.

How to get <img> src from CDATA in RSS?
Some of my site users prefer a light theme, others prefer dark one. In drupal 6, is there a way to allow users to choose their favorite theme? How?
Thanks
