【PHP】下らねぇ質問はここに書き込みやがれ 8at TECH
【PHP】下らねぇ質問はここに書き込みやがれ 8 - 暇つぶし2ch815:795
17/10/29 11:31:50.57 htd7uCcc0.net
>>798
private function request($url, $context = null) {
 $http_request_header = null;
 if (!$context) {
 $cookie = $this->getCookie($url);
 $context = [
  'http' => [
   'method' => 'GET',
   'protcol_version' => 1.1,
   'ignore_errors' => true,
   'header' => 'Host: ' . parse_url($url)['host'] . "\r\n",
   'Cookie: ' . $cookie . "\r\n",
   "Connection: close\r\n"
  ]
 ];
 $body = file_get_contents($url, false, stream_context_create($context));
 $this->setCookie($url, $http_response_header);
 return [$http_response_header, $body];
}
こんな感じです。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch