Created
October 5, 2016 04:51
-
-
Save idhamperdameian/584747fd6862f6f23a09f948f7360d6a to your computer and use it in GitHub Desktop.
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 | |
$options = array( | |
CURLOPT_URL => 'https://www.google.co.id', | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_HEADER => 0, | |
CURLOPT_FOLLOWLOCATION => 1, | |
CURLOPT_ENCODING => "", | |
CURLOPT_AUTOREFERER => 1, | |
CURLOPT_CONNECTTIMEOUT => 120, | |
//CURLOPT_TIMEOUT => 120, | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_SSL_VERIFYPEER => 0, | |
CURLOPT_SSL_VERIFYHOST => 0, | |
); | |
$ch = curl_init(); | |
curl_setopt_array($ch, $options); | |
$output = curl_exec($ch); | |
$header = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
$err = curl_error($ch); | |
curl_close($ch); | |
echo $header.' <-- Header -- '.$err.'<br><br>'; | |
echo $output.'<br><br>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment