PHP file_get_contents 设置超时时间
生活随笔
收集整理的這篇文章主要介紹了
PHP file_get_contents 设置超时时间
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
? ? $opts = array('http' =>
array(
'method' ?=> 'GET',
'timeout' => 3
)
);
$context ?= stream_context_create($opts);
$url = "www.google.com";
$text = @file_get_contents($url,false,$context,-1,100);
if($text==FALSE){
?return FALSE;
}
return TRUE;
轉載于:https://blog.51cto.com/livestreaming/1747221
總結
以上是生活随笔為你收集整理的PHP file_get_contents 设置超时时间的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jmeter远程测试
- 下一篇: mysql源代码安装