added example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@148887 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2004-01-16 20:03:06 +00:00
parent 1f06e33776
commit 6700039154

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
<refentry id="function.apache-lookup-uri">
<refnamediv>
@ -44,6 +44,50 @@
<member>request_time</member>
</simplelist>
</para>
<para>
<example>
<title><function>apache_lookup_uri</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$info = apache_lookup_uri('index.php?var=value');
print_r($info);
if (file_exists($info->filename))
echo 'file exists!';
?>
]]>
</programlisting>
<para>
The above example will output something similar with:
</para>
<screen>
<![CDATA[
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!
]]>
</screen>
</example>
</para>
<note>
<simpara>
<function>apache_lookup_uri</function> only works when PHP