Php 从rss源获取图像url?

Php 从rss源获取图像url?,php,regex,rss,Php,Regex,Rss,我需要从这个rss源获取图像url。 我正在使用dom文档获取数据 <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"> <channel> <title><![CDATA[Accessories]]></title> <l

我需要从这个rss源获取图像url。 我正在使用dom文档获取数据

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[Accessories]]></title>
    <link>http://abcde.com/accessories</link>
    <description><![CDATA[Accessories]]></description>
    <pubDate>Fri, 08 Feb 2013 10:16:45 +0000</pubDate>
    <generator>Zend_Feed</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Jabra HALO 2 JBRA2113 Wireless Headset]]></title>
      <link>http://abcde.com/accessories/jabra-halo-2-jbra2113-wireless-headset</link>
      <description><![CDATA[<table><tr><td><a href="http://abcde.com/accessories/jabra-halo-2-jbra2113-wireless-headset"><img src="http://abcde.com/media/catalog/product/cache/1/thumbnail/75x75/9df78eab33525d08d6e5fb8d27136e95/h/a/halo2_frontview_1440x810.jpg" border="0" align="left" height="75" width="75"></a></td><td  style="text-decoration:none;">






    <div class="price-box">
                                                            <span class="regular-price" id="product-price-1041"><span class="price">Rs. 6,499.00</span></span>

        </div>

</td></tr></table>]]></description>
      <pubDate>Fri, 08 Feb 2013 10:16:45 +0000</pubDate>
    </item>

  </channel>
</rss>

也许您只想获得img src-s:

"#<img[^>]+src=[\"|']([^\"]*)[\"|']#"
”#
因此,我们可以举一个例子

preg_replace_callback("#<img[^>]+src=[\"|']([^\"]*)[\"|']#",function($matches){print_r($matches[1]);return $matches[0];},' '.$STR.' ');
preg\u replace\u回调(“#
preg_replace_callback("#<img[^>]+src=[\"|']([^\"]*)[\"|']#",function($matches){print_r($matches[1]);return $matches[0];},' '.$STR.' ');