Skip to content

Instantly share code, notes, and snippets.

@croensch
Last active January 24, 2018 21:14
Show Gist options
  • Save croensch/950814d01626df90ef40901c2fda9fc4 to your computer and use it in GitHub Desktop.
Save croensch/950814d01626df90ef40901c2fda9fc4 to your computer and use it in GitHub Desktop.
<?php
$c = curl_init();
curl_setopt_array($c, array(
CURLOPT_URL => $argv[1],
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_VERBOSE => true
));
$r = curl_exec($c);
if (curl_errno($c)) {
die(curl_error($c));
}
curl_close($c);
echo substr($r, 0, strpos($r, "\n", 256));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment