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;

原文地址:https://www.cnblogs.com/thinkingthigh/p/7092873.html