您好,欢迎访问一九零五行业门户网

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
以上就介绍了file_get_contents超时设置,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息