0
I’m trying to get a description of feed to display on a site I have to do, but when trying to catch it returns to me as empty. When I see the source code of the link that the feed is in, the description is there:
<description><![CDATA[
<div>
<a href="http://eissomesmo.com.br/blog/e-dicas/"><img title="Eisso4" src="http://eissomesmo.com.br/blog/wp-content/uploads/2016/02/Eisso4.jpg" alt="É Dicas!" width="230" height="230" /></a>
</div>
Para um conteúdo cumprir a sua função, deve ser feito adaptado para ser exibido em várias plataformas de mídia e pensado estrategicamente para atrair a atenção do público-alvo e mantê-lo. Este conteúdo pode assumir diversas formas como notícias, videos instrutivos, e-books, posts de blog, guias, artigos, perguntas e respostas, imagens, entre outros. Empresas que constroem]]></description>
But PHP returns me empty when I pull the tag description
. I’m using this code:
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,'http://eissomesmo.com.br/blog/feed/');
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'rss');
$query = curl_exec($curl_handle);
curl_close($curl_handle);
$rss = new SimpleXmlElement($query);
echo '<pre>';
echo var_dump($rss->channel->item->description);
echo '</pre>';
The Feed is being generated by Wordpress. Link to the feed is http://eissomesmo.com.br/blog/feed/
worked out, just displayed something else, which was the content of
<div></div>
that I don’t need, because the image has already taken another way. You would know how to remove the content that is between the tag<div>
?– Alisson Acioli
@Alisson Acioli well this was not in your initial question, you were just saying that the value was empty :P, but with an ER I read the internal data and return in a matrix, I hope this is it.
– SK15