How to handle a feed with .rss extension

1

I get an XML through a feed URL with .RSS extension. I'm trying to read the XML and I was not successful. I tried the following ways:

$url = 'http://www.feedaqui.com.br/recent.rss';
$xml = simplexml_load_file($url);

$url = 'http://www.feedaqui.com.br/recent.rss';
$xml = simplexml_load_string(file_get_contents($url));

Generating the error:

Warning: simplexml_load_file(): I/O warning : failed to load external entity
    
asked by anonymous 06.01.2015 / 14:27

1 answer

0
$curl = curl_init();

curl_setopt_array($curl, Array(
    CURLOPT_URL            => 'http://www.feedaqui.com.br/recent.rss';
    CURLOPT_USERAGENT      => 'spider',
    CURLOPT_TIMEOUT        => 120,
    CURLOPT_CONNECTTIMEOUT => 30,
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_ENCODING       => 'UTF-8'
));

$data = curl_exec($curl);

curl_close($curl);

$xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
    
09.01.2015 / 21:33