Re[2]: [PHP] problem in fopen
| From: | Àíòîí | Date: | Tue, 20 May 2003 11:43:28 +0000 |
| Subject: | Re[2]: [PHP] problem in fopen | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148282@lists.php.net to get a copy of this message | ||
Hi
JW> On Tuesday 20 May 2003 15:25, HPS wrote:
>> i tried to get some data from a remote website by using fopen().
>>
>> $data_path = http://www.mysite.com/data.txt";
>> $fp = @fopen ($data_path, "r");
>>
>> The script works fine if the remove site (http://www.mysite.com/data.txt)
>> is up and accessible.
>> However, the script take a very long time to run if the server is down.
>>
>> Is it possible to add any time constraint in the script such that the
>> fopen() operation will abort, say, after 10 seconds ?
>> Or any alternative suggestion?
I would recommend you to use curl functions
--
Regards
Anton