2013-06-04 25 views

回答

2

我假设你要求一个PHP应用程序。

在http上下文中根据this文档设置截止日期。

$options = ["http" => ["timeout" => 60]]; 
$context = stream_context_create($options); 
$data = file_get_contents("http://foo.bar", false, $context); 
0

试试这个

$context = 
    array("http"=> 
     array(
     "timeout" => 60 
    ) 
    ); 
$context = stream_context_create($context); 
$result = file_get_contents("http://example.com", false, $contex); 
相关问题