I am trying to read xml file from "http://synd.cricbuzz.com/score-gadget/gadget-scores-feed.xml" I understand its caching issue so i have added no-cache but stil its returning same file :(
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache"); Header('Pragma: no-cache');
$url = "http://synd.cricbuzz.com/score-gadget/gadget-scores-feed.xml";
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
print $result;
$fp = fopen('score.xml', 'w');
if($fp)
fwrite($fp, $result);
else
echo "Error !";
$url = "score.xml";
$xml = simplexml_load_file($url);
var_dump($xml);
?>