PHP獲取當前url路徑的函數及服務器變量:
代碼
<?php
$path = /usr/opt/
echo $_SERVER[
echo $_SERVER[
echo __FILE__
echo dirname(__FILE__); //獲得文件所在的文件夾路徑的函數
echo realpath($pah);
?>
返回的值
/usr/opt/apache
/alias/aa
/usr/opt/apache
/usr/opt/apache
/usr/etc/abcd
From:http://tw.wingwit.com/Article/program/PHP/201311/20906.html