Before I make this question, I've been looking and have found some matches ... Like
but can not display images, And
but there is no link... I want, Title, Image and URL. How? Can you help me??
This my code:
$html = "";
$url = "https://www.ciusan.com/feed/";
$xml = simplexml_load_file($url);
echo '<div class="row">';
for($i = 0; $i < 5; $i++){
$image = $xml->channel->item[$i]->children('media', True)->content->attributes();
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->link;
$description= $xml->channel->item[$i]->description;
$pubDate = $xml->channel->item[$i]->pubDate;
$html .= '<div align="center" class="one-fifth columns">';
$html .= "<img src='".$image."' alt='".$title."'>";
$html .= "<a href='$link'><h3>$title</h3></a>";
// $html .= "$description";
// $html .= "<br />$pubDate";
$html .= '</div>';
}
echo $html;
echo '</div>';
I want to showing feed from other sites in my site, i want showing image, title and link to the title post.. With my code the title and link can showing, but the image not showing with the error
Warning: SimpleXMLElement::__toString(): Node no longer exists in C:\dev\www\public_html\01\example.php on line 155