ITeye博客

[BASE] file_get_contents通过代理获取网络地址内容

marx · 2013-04-26 22:12 · php · Web前端 · Markdown

$opt = array(

     'http'=>array(

           'method'=>'GET',

           'header'=>"Content-Type:text/html;charset=utf-8"

           'proxy'=>"http://192.168.1.1:8080",

           'timeout'=>30

 

      )

);

 

$context = stream_context_create($opt);

 

$result = file_get_contents("http://www.iteye.com",false,$context);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。