Im having a feed that is password protected. Below is the code used to access the feed
$url = 'http://thefeedwebsite.com/feed.php';
$data = array("username" => ‘user’, "password" => ‘password’, "location" => "HK")
$ch = curl_init($url);
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
$output = curl_exec($ch);
curl_close($ch);
The problem is that due to large size after outputting about 100 results it keeps on timeout. I have set the time limit in my php.ini as some threads suggested but still the same issue. I think its because CURL loads the complete feed to the memory.
Is it possible to load the $output
directly to XMLReader()
in php so I can process the feed through the reader faster?
Sorry is the question is totally noob. Just started learning php with xml