标签: php timeout
是否可以运行php file_get_content最多25秒并停止收到的内容并继续?目标是捕获超时错误。
这不会解决问题,因为它只会延长时间和最终的致命错误。
$opts = array('http' => array('method' => 'GET', 'timeout' => 120)); $context = stream_context_create($opts); $html = @file_get_contents($crLink, false, $context);