file_get_contents超时设置
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
阅读更多声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。