Skip to content

Instantly share code, notes, and snippets.

@lineker
Created March 9, 2012 00:20
Show Gist options
  • Save lineker/2004301 to your computer and use it in GitHub Desktop.
Save lineker/2004301 to your computer and use it in GitHub Desktop.
PHP: Download XML using GET and CURL
$url = "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml = curl_exec($ch);
curl_close($ch);
return $xml;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment