Skip to content

Instantly share code, notes, and snippets.

@Jarvl
Created February 18, 2016 22:13
Show Gist options
  • Save Jarvl/00d85e9f79e36894ebbd to your computer and use it in GitHub Desktop.
Save Jarvl/00d85e9f79e36894ebbd to your computer and use it in GitHub Desktop.
curl test
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://lamproslabs.com',
CURLOPT_CONNECTTIMEOUT => 10
));
$data = curl_exec($curl);
if ($data === FALSE) {
printf("cUrl error (#%d): %s<br>\n", curl_errno($curl), htmlspecialchars(curl_error($curl)));
}
curl_close($curl);
die($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment