会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Firmy Racing
life without limit.
博客园
首页
新随笔
联系
订阅
管理
2012年12月15日
file_get_content没远程没响应解决方案
摘要: file_get_contents是个好东西,在接口调用中经常用到,弊端就是在远程接口没有响应时,执行就会卡住直到超时很不爽,于是修改http头,如下:$ctx=stream_context_create(array( 'http'=>array( 'timeout'=>3//等待3秒 ) ) ); $result = @file_get_contents ( $url,0,$ctx );bing...
阅读全文
posted @ 2012-12-15 10:14 firmy
阅读(342)
评论(0)
推荐(0)
编辑
公告