Skip to content

Instantly share code, notes, and snippets.

@2J
Created April 21, 2015 00:09
Show Gist options
  • Save 2J/ca6f9ae967c9b5beb95f to your computer and use it in GitHub Desktop.
Save 2J/ca6f9ae967c9b5beb95f to your computer and use it in GitHub Desktop.
PHP curl
<?php
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "google.com");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment