0

I'm having a bit of a problem with reading an XML file (RSS feed). I'm using file_get_contents to read the data, which works fine locally on Xampp, but won't work on my server.

I don't want to have to edit my php.ini file, I'm after a out-of-the-box solution if there is one (I want the code to be as portable as possible).

I am currently doing...

    //  Load Correct Feed
    $feed_url = $this->selectFeed($instance);
    $content = file_get_contents($feed_url);
    $x = new SimpleXmlElement($content);  

I've had a look for solutions (ie. cURL) but can't find a way that will be supported universally.

Please could someone point me in the right direction (if it is even possible)?

4

1 回答 1

1

关于什么...

$xml = simplexml_load_file($file);
于 2013-06-13T14:29:32.553 回答