I've searched a lot over the past few days but i'm now resigning to asking for help.
I'm parsing a number of news websites using PHP's simplexml_load_file(), my code is below....
foreach ($sourceID as $s) {
$xml = simplexml_load_file($s['rss']);
$dateTimeArray = [];
if ($xml != false) {
foreach($xml->channel->item as $item)
{
foreach($item->pubDate as $date) {
$dateTimeArray[] = (string) $date;
}
$s['dateTimeList'] = $dateTimeArray;
}
array_push($source, $s);
} else {
echo 'error '.$s['id'];
}
}
There are some sites that have "This XML file does not appear to have any style information associated with it. The document tree is shown below." displayed at the top, this is something to do with not being correctly read as an XML document?
Ultimately my php code will not parse any data from the websites that display this message, any help that can be easily added to my present code would be greatly appreciated.
One of the xml feeds in question is this one https://cointelegraph.com/rss
Thanks!