note 91157 deleted from function.file-get-contents by danbrown
| From: | danbrown@php.net | Date: | Wed, 27 May 2009 22:34:47 +0000 |
| Subject: | note 91157 deleted from function.file-get-contents by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156097@lists.php.net to get a copy of this message | ||
Note Submitter: Stefan Nowak
----
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.