Created
February 18, 2016 22:13
-
-
Save Jarvl/00d85e9f79e36894ebbd to your computer and use it in GitHub Desktop.
curl test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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