Created
March 13, 2013 07:29
-
-
Save narita1980/5149985 to your computer and use it in GitHub Desktop.
proxy経由でfile_get_contentsを利用する方法 [参考サイト]
http://www.php.net/manual/ja/function.file-get-contents.php#58758
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 | |
$proxy = array( | |
'http' => array( | |
'proxy' => 'tcp://127.0.0.1:8080', | |
'request_fulluri' => True, | |
), | |
); | |
$context = stream_context_create($proxy); | |
// Now all file stream functions can use this context. | |
$sFile = file_get_contents("http://www.php.net", False, $context); | |
echo $sFile; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment