// 获取当前目录
echo realpath("."). "
";
echo getcwd() . "
";
// 获取上级目录
echo realpath(".."). "
";
// 获取网站根目录
echo $_SERVER['DOCUMENT_ROOT']. "
";
// 获取目录信息
$path_parts = pathinfo(__FILE__);
echo $path_parts["dirname"] . "
";
echo $path_parts["basename"] . "
";
echo $path_parts["extension"] . "
";
echo dirname(__FILE__). "
";
得到的是文件上一层目录名
echo dirname(dirname(__FILE__));
阅读(718) | 评论(0) | 转发(0) |