Fork me on GitHub

php发送请求

$opts = array(
  'http'=>array(
    'method'=>"GET",
    'timeout'=>10,
  )
);
$context = stream_context_create($opts);
$html =file_get_contents('http://www.example.com', false, $context);
echo $html;

posted @ 2017-06-29 09:54  思考的大腿  阅读(99)  评论(0编辑  收藏  举报