Sends a http request to www.example.com

$opts = array(
 'http'=>array(
   'method'=>"GET",
   'header'=>"Accept-language: en\r\n" .
             "Cookie: foo=bar\r\n"
 )
);

$context = stream_context_create($opts);

/* Sends a http request to www.example.com
  with additional headers shown above */
$fp = fopen('http://www.example.com', 'r', false, $context);
fpassthru($fp);
fclose($fp);

转载请注明出处:https://www.onexin.net/sends-an-http-request-to-www-example-com/

随机文章:

1、对付病毒,流氓软件只有一招——杀
https://www.onexin.net/%e5%af%b9%e4%bb%98%e7%97%85%e6%af%92%ef%bc%8c%e6%b5%81%e6%b0%93%e8%bd%af%e4%bb%b6%e5%8f%aa%e6%9c%89%e4%b8%80%e6%8b%9b%e2%80%94%e2%80%94%e6%9d%80/

2、wp文章内url链接识别
https://www.onexin.net/url-link-to-the-article-identified-wp/

3、用CSS做滑动效果的图片画廊
https://www.onexin.net/picture-gallery-of-the-sliding-effect-with-css/

4、JAVA扑克牌随即五张(数组实现)
https://www.onexin.net/java-poker-then-five-array-implementation/

5、在线采集需要登陆的网站文章内容
https://www.onexin.net/need-to-visit-the-site-collected-online-article-content/

Leave a Reply