(PHP 4, PHP 5)
apache_lookup_uri — 지정한 URI에 부분 요청을 수행하고 그에 대한 정보를 반환
URI에 부분 요청을 수행합니다. 주어진 리소스에 대해 중요한 모든 정보를 가집니다.
이 함수는 PHP를 아파치 모듈로 설치하였을 때만 지원합니다.
요청할 파일명(URI).
URI 정보에 관련된 object. 이 object가 가지는 프로퍼티는:
Example #1 apache_lookup_uri() 예제
<?php
$info = apache_lookup_uri('index.php?var=value');
print_r($info);
if (file_exists($info->filename)) {
echo 'file exists!';
}
?>
위 예제의 출력 예시:
stdClass Object
(
[status] => 200
[the_request] => GET /dir/file.php HTTP/1.1
[method] => GET
[mtime] => 0
[clength] => 0
[chunked] => 0
[content_type] => application/x-httpd-php
[no_cache] => 0
[no_local_copy] => 1
[unparsed_uri] => /dir/index.php?var=value
[uri] => /dir/index.php
[filename] => /home/htdocs/dir/index.php
[args] => var=value
[allowed] => 0
[sent_bodyct] => 0
[bytes_sent] => 0
[request_time] => 1074282764
)
file exists!