Skip to content

Instantly share code, notes, and snippets.

@pkdavies
Created October 31, 2013 16:27
Show Gist options
  • Save pkdavies/7252669 to your computer and use it in GitHub Desktop.
Save pkdavies/7252669 to your computer and use it in GitHub Desktop.
<?php
// set the URL
$url = "http://www.juicymedia.co.uk";
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'AGENT/1.0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
// grab URL and pass it to the browser
$output = curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
// output to screen
echo $output;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment