Skip to content

Instantly share code, notes, and snippets.

@Dianakc
Last active December 15, 2015 08:49
Show Gist options
  • Save Dianakc/af18073613058855175c to your computer and use it in GitHub Desktop.
Save Dianakc/af18073613058855175c to your computer and use it in GitHub Desktop.
<?php
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment