首頁  >  文章  >  後端開發  >  file_get_contents逾時設定

file_get_contents逾時設定

WBOY
WBOY原創
2016-08-08 09:23:321687瀏覽

file_get_contents逾時設定

// Create the stream context 

com  'http' => array(

      ' timeout' => 3000 //逾時時間,單位為秒

     ) 

));

$contents = file_get_contents('http://sample.com', 0, $context);

參考:http://www.acwind.net/blog/archives/1269

🎜🎜🎜 🎜 以上就介紹了file_get_contents逾時設置,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。 🎜 🎜 🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn