Good afternoon !, Personal I am using a php code to display news of a website, I happen to try to also display the image that it has, however, I can not, the title and date of posting I am able to display normal, however , I can not do this
<?php
// Mostrar Data na Tela.
$titulo = array();
$data = array();
$link = array();
$quantos = 0;
$exibir = 1;
$limite_title = 100;
foreach(simplexml_load_file("http://cidades.gov.br/ultimas-noticias?format=feed&type=rss")->channel->item as $item)
{
$imagem[] = $item->src;
$titulo[] = utf8_decode(substr($item->title, 0, $limite_title)."...");
$link[] = $item->link;
$data[] = utf8_decode($item->pubDate);
$quantos++;
}
for($i = $quantos-($exibir+1); $i < $quantos-1; $i++)
{
if($titulo[$i]!="")
{
echo
'
<li>
<figure><img src="'.$imagem[$i].'"></figure>
<a href="'.$link[$i].'" target="_blank" title="Leia mais clicando aqui!">'.utf8_encode($titulo[$i]).'
<small style="font-size:11px;color:#999;"><br/></a>'.str_replace(" ", " as ", date('d/m/Y H:m:s', strtotime($data[$i]))).'</small>
</li>
';
}
}
?>
What did I do wrong?