Created
October 22, 2012 15:17
-
-
Save glagola/3931984 to your computer and use it in GitHub Desktop.
file_get_contents proxy
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 = 'http://www'; | |
$proxy = 'tcp://xxx:8080'; | |
$context = array( | |
'http' => array( | |
'proxy' => $proxy, | |
'request_fulluri' => True, | |
), | |
); | |
$context = stream_context_create($context); | |
$body = file_get_contents($url, False, $context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment