note 91156 added to context.http

From: Date: Wed, 27 May 2009 17:05:47 +0000
Subject: note 91156 added to context.http
Groups: php.notes 
Request: Send a blank email to php-notes+get-156088@lists.php.net to get a copy of this message
I would like to make decisions based on whether file_get_contents had a timeout or not. Currently I only know from a timeout by reading php's console warning messages, which read like this: Warning: file_get_contents(<url>): failed to open stream: Operation timed out in <sourcefile.php> But I would like to know how to access the timeout information from within PHP code. Sadly, file_get_contents() only returns an int $bytesLoaded on load success or int FALSE on failure, but no information whether a timeout has occured. ---- Server IP: 69.147.83.197 Probable Submitter: 212.186.192.86 ---- Manual Page -- http://www.php.net/manual/en/context.http.php Edit -- https://master.php.net/note/edit/91156 Del: integrated -- https://master.php.net/note/delete/91156/integrated Del: useless -- https://master.php.net/note/delete/91156/useless Del: bad code -- https://master.php.net/note/delete/91156/bad+code Del: spam -- https://master.php.net/note/delete/91156/spam Del: non-english -- https://master.php.net/note/delete/91156/non-english Del: in docs -- https://master.php.net/note/delete/91156/in+docs Del: other reasons-- https://master.php.net/note/delete/91156 Reject -- https://master.php.net/note/reject/91156 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156088) next »