php 获取文件绝对路径

echo $_SERVER['PHP_SELF'];
echo "
";
echo str_replace("/","\\",$_SERVER['PHP_SELF']);
echo "
";
echo __FILE__;
echo "
";
define("WWWROOT",str_ireplace(str_replace("/","\\",$_SERVER['PHP_SELF']),'',__FILE__)."\\");
echo WWWROOT ;
echo "
";
echo str_replace("/","\\",$_SERVER['DOCUMENT_ROOT']."\\");

你可能感兴趣的:(php学习)