Quantcast
Channel: How to display image from RSS feed using PHP - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Marat Badykov for How to display image from RSS feed using PHP

$
0
0

Try this

$found = preg_match("/img src=\"([^\"]+)\"/", $content, $match);

if ($found)
{
    echo '<div id="image"><img class="feed-item-image" src="' . (string)$match[1] . '" /></div>';
}

Maybe problem in your css file and feed-item-image class. Can you just try

"<img src=\"" . (string)$match[1] . "\">";

instead of

'<div id="image"><img class="feed-item-image" src="' . (string)$match[1] . '" /></div>'

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images