file_get_contents超时处理
<div id="cnblogs_post_body">file_get_contents(url)超时处理,比较好的方式是怎么样的?$opts = array(
2.&lsquo;http'=>array(
3.&lsquo;method'=>&rdquo;GET&rdquo;,
4.&lsquo;timeout'=>60,
5.)
6.);
7.$context = stream_context_create($opts);
8.$html =file_get_contents('example.com', false, $context);
9.fpassthru($fp);
有没有比这个方式要好的?
curl
本文来源于http://code.niuc.org/thread-965-1-5.html,转载请注明出处。
页:
[1]