php - Getting Img Tag from RSS Description -
i have couple of rss feeds hide images within pesky description tag.
i'm trying image src description, seem failing every solution on here.
<description><![cdata[duration: 604 sec<br>url: http://www.test.com/videos/998879/surf.mpeg<br><img src="http://test.test.com/320x240/461/1055458.jpg"><br><iframe src="http://test.com/embed/998879" frameborder=0 width=650 height=518 scrolling=no></iframe>]]></description>
as can see it's bit stuck in there!
function echo_url($string) { preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $string, $match); return $match[0][0]; }
currently using function try , retrieve image no luck!
any brilliant!
$description = '<description><![cdata[duration: 604 sec<br>url: http://www.test.com/videos/998879/surf.mpeg<br><img src="http://test.test.com/320x240/461/1055458.jpg"><br><iframe src="http://test.com/embed/998879" frameborder=0 width=650 height=518 scrolling=no></iframe>]]></description>'; $html = str_get_html($description); echo $html->find('img', 0)->src;
Comments
Post a Comment