<?php
$ctx
= stream_context_create(
array
(
'http'
=>
'timeout'
=> 1
//设置一个超时时间,单位为秒
)
);
file_get_contents
"http://example.com/"
, 0,
?>