[php]proxy経由でfile_get_contentsを使用する方法
プロキシ経由でfile_get_contentsするサンプルコードをご紹介。
$url = "https://blog.verygoodtown.com/";
$proxy = array(
"http" => array(
"proxy" => "tcp://プロキシHOST:ポート",
'request_fulluri' => true,
),
);
$proxy_context = stream_context_create($proxy);
echo file_get_contents($url,false,$proxy_context);
1時間はまってましたorz
最新情報をお届けします