problem in fopen
| From: | HPS | Date: | Tue, 20 May 2003 07:25:39 +0000 |
| Subject: | problem in fopen | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148249@lists.php.net to get a copy of this message | ||
Dear all,
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?
thx a lot~~~
HPS