convert file_put_contents to curl
<p>I have a function to create cache data xml file on my server.
I've used file_get_contents and file_put_contents, but now my hosting provider is restricting usage of them. The single way to use same function is to convert it to CURL. Can anyone give some ideas?</p>

<pre><code>function checkXmlCache($xmlQuery)   {
$fibulabasexml="http://any url that give xml data/";    $cachedir="/tmp/";  $ageInSeconds = 36000;
$xmlQuery=str_replace(array("'",'"'),"",$xmlQuery);
  $xmlQuery2=$xmlQuery;
  $long=array("stars=","TURKEY","bestprice=","country=", "location=","hotelcode=","prices=yes","tara=","simple=yes","rand()","sort=","limit=","price ","hotelname"," desc","desc");
  $short=array("ST-","TR","B-","C-",        "L-",       "H-",        "PY-",   "T-", "-S-",      "-R-",  "S-",   "LT-",  "PP-","HN","-D","-D");
  $xmlQuery2=str_replace($long,$short,$xmlQuery2);
  $xmlQuery2=str_replace(array("xmlhotels.php","xmllocations.php"),array("XH-","XL-"),$xmlQuery2);
  $xmlQuery2=str_replace(array("&amp;","?"),array(""),$xmlQuery2);
  $xmlQuery2.="_.XML";
  $xmlQuery2=strip_tags($xmlQuery2);

if(!file_exists($cachedir.$xmlQuery2) || (filemtime($cachedir.$xmlQuery2) + $ageInSeconds &lt; (time() )) ) {
  $contents = file_get_contents($fibulabasexml.str_replace(" ","%20",$xmlQuery));
  if(strlen($contents)&gt;200 ) {  file_put_contents($cachedir.$xmlQuery2, $contents); }
}
return($cachedir.$xmlQuery2);
</code></pre>

<p>Thanks for helping!</p>