array(       "timeout" => 3000 //超时时间,单位为秒      )  ));  " />
牛骨文教育服务平台(让学习变的简单)
博文笔记

file_get_contents超时设置

创建时间:2015-05-28 投稿人: 浏览次数:658

file_get_contents超时设置

// Create the stream context 

$context = stream_context_create(array(

     "http" => array(

      "timeout" => 3000 //超时时间,单位为秒

     ) 

));  

// Fetch the URL"s contents 

$contents = file_get_contents("http://sample.com", 0, $context);

参考:http://www.acwind.net/blog/archives/1269

阅读更多
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。