php中的几个目录函数
[ 2014-08-15 15:53:10 | 作者: admin ]
<?php
echo 'documentroot:'.$_SERVER['DOCUMENT_ROOT'].'<br>'; //根目录,在apache的配置文件里定义:httpd.conf 比如:DocumentRoot "D:/work/php_root"
echo 'httphost:'.$_SERVER['HTTP_HOST'].'<br>'; //域名,比如:localhost
echo 'phpself:'.$_SERVER['PHP_SELF'].'<br>'; // 从根目录到文件本身的路径
echo 'script filename'.$_SERVER['SCRIPT_FILENAME'].'<br>'; //documentroot+phpself
echo 'request uri'.$_SERVER['REQUEST_URI'].'<br>'; //从根目录开始所有的URL字符串,包括问号之后的字符
...echo 'documentroot:'.$_SERVER['DOCUMENT_ROOT'].'<br>'; //根目录,在apache的配置文件里定义:httpd.conf 比如:DocumentRoot "D:/work/php_root"
echo 'httphost:'.$_SERVER['HTTP_HOST'].'<br>'; //域名,比如:localhost
echo 'phpself:'.$_SERVER['PHP_SELF'].'<br>'; // 从根目录到文件本身的路径
echo 'script filename'.$_SERVER['SCRIPT_FILENAME'].'<br>'; //documentroot+phpself
echo 'request uri'.$_SERVER['REQUEST_URI'].'<br>'; //从根目录开始所有的URL字符串,包括问号之后的字符
阅读全文…
1