apache_lookup_uri

(PHP 3 >= 3.0.4, PHP 4, PHP 5)

apache_lookup_uri --  Осуществить частичный запрос на указанный URI и вернуть все полученные сведения

Описание

object apache_lookup_uri ( string filename )

Эта функция осущестслвяет частичный запрос на указанный URI и, проведя анализ полученных данных, возвращает их в классе. Свойствами возвращаемого класса являются:

status
the_request
status_line
method
content_type
handler
uri
filename
path_info
args
boundary
no_cache
no_local_copy
allowed
send_bodyct
bytes_sent
byterange
clength
unparsed_uri
mtime
request_time

Замечание: Функция apache_lookup_uri() доступна только в том случае, если PHP работает в качестве модуля Apache.



apache_lookup_uri
trejkaz
04-Aug-2005 06:09
Apparently on PHP 4.2, this function returns an array instead of an object.

That being the case, the example code above would translate to:

<?php
$info
= apache_lookup_uri('index.php?var=value');
print_r($info);

if (
file_exists($info['filename'])) {
   echo
'file exists!';
}
?>

A means of making this transparent so that the object syntax works, is left as an exercise for the reader. ;-)
redbeard at mdjohnson dot nospam dot us
17-Apr-2003 05:15
A useful feature is that if you have content negotiation on (Options MultiViews) Apache will resolve the negotiation for you if possible.  Thus www.example.com/blah will resolve to /base/blah.php or /base/blah.html or even /base/blah.en.html as appropriate.

<apache_getenvapache_note>
 Last updated: Mon, 14 Nov 2005