Remote file information (PHP 4.0)
| From: | Erik Fears | Date: | Wed, 05 Jun 2002 21:05:30 +0000 |
| Subject: | Remote file information (PHP 4.0) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100797@lists.php.net to get a copy of this message | ||
Is there a way, when requesting remote files (using fopen() or file()) to
determine the base directory of the file retrieved? For instance, if I did:
$file = file("http://www.host.com/directory/php");
Several things can happen. One is that theres an actual file named php that
is retrieved. Secondly, php could be a directory and the file index.html is
retrieved from that directory. Or php could be a directory without an index,
in which case a directory listing is generated or something to that effect.
But what I want to be able to do is to determine what the base directory is
in any case. For instance if php was a file, the base would be
http://www.host.com/directory/, if it was a directory
with an index the base
would be http://www.host.com/directory/php.
Anyone know if this information is available?
Thanks,
Erik Fears.