1
I have some xml files, and several of them the news images are inside the Description, in one of them the image is inside the CDATA, at the time I return the array to Description does not appear any element according to the photo:
in another case the image is already inserted inside the Description that does not contain a CDATA as in the image below:
we two cases I’m not able to find a way to manipulate these images the way I want, I was wondering if you could help me,
I’ll post my code here too, for now it’s simple I’m still developing it, and I can’t get out of that part.
$feedwwf = file_get_contents('https://www.wwf.org.br/rss/rss.cfm?B5ABCD22-
A9C2-3BB4-44189EF9064E5481',LIBXML_NOCDATA);
$rsswwf = new SimpleXMLElement($feedwwf);
$wwf = $rsswwf->channel->item[0];
$desc = $wwf->description;
$feedg1 = file_get_contents('http://pox.globo.com/rss/g1/');
$rssg1 = new SimpleXMLElement($feedg1);
$g1 = $rssg1->channel->item[0];
$desc = $g1->description->attributes('img') ;