Created
September 30, 2014 18:47
-
-
Save MattRead/0db9267844c74b08d3e5 to your computer and use it in GitHub Desktop.
This file contains 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 | |
$url = 'https://api.github.com/repos/MattRead/conquistador/git/blobs/82c300571af3a69609466e51c3f057c75cc1df09'; | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header'=>"Accept-language: en\r\n" . | |
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6\r\n". | |
"Cookie: foo=bar\r\n" | |
) | |
); | |
$context = stream_context_create($opts); | |
if ( fopen( $url, "r", false, $context ) != true ) { | |
echo "bad"; | |
} | |
else echo "good"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment