SimpleXML - I/O warning : failed to load external entity

后端 未结 4 1450
深忆病人
深忆病人 2020-12-28 14:09

I\'m trying to create a small application that will simply read an RSS feed and then layout the info on the page.

All the instructions I find make this seem simplist

4条回答
  •  执笔经年
    2020-12-28 14:48

    You can also load the content with cURL, if file_get_contents insn't enabled on your server.

    Example:

    $ch = curl_init();  
    
    curl_setopt($ch,CURLOPT_URL,"http://feeds.bbci.co.uk/sport/0/football/rss.xml?edition=int");
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    
    $output = curl_exec($ch);
    
    curl_close($ch);
    
    $items = simplexml_load_string($output);
    

提交回复
热议问题