失去服务器绝对路径的PHP代码
程序员文章站
2022-04-27 08:46:09
...
得到服务器绝对路径的PHP代码
echo "__FILE__ :
echo "dirname(__FILE__) :
echo "\$_SERVER['DOCUMENT_ROOT']:
echo "\$_SERVER['PHP_SELF'] :
echo "dirname(\$_SERVER['PHP_SELF']) :
echo "
echo "realpath('./') :
$pathInfo = pathinfo(__FILE__);
echo "pathinfo(__FILE__,PATHINFO_DIRNAME):
echo "pathinfo(__FILE__,PATHINFO_BASENAME):
echo "pathinfo(__FILE__,PATHINFO_EXTENSION]):
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
echo "__FILE__ :
".__FILE__."
";echo "dirname(__FILE__) :
".dirname(__FILE__)."
";echo "\$_SERVER['DOCUMENT_ROOT']:
".$_SERVER['DOCUMENT_ROOT']."
";echo "\$_SERVER['PHP_SELF'] :
".$_SERVER['PHP_SELF']."
";echo "dirname(\$_SERVER['PHP_SELF']) :
" .dirname($_SERVER['PHP_SELF'])."
";echo "
".$_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF'])."
";echo "realpath('./') :
".realpath('./')."
";$pathInfo = pathinfo(__FILE__);
echo "pathinfo(__FILE__,PATHINFO_DIRNAME):
".$pathInfo[dirname]."
";echo "pathinfo(__FILE__,PATHINFO_BASENAME):
".$pathInfo[basename]."
";echo "pathinfo(__FILE__,PATHINFO_EXTENSION]):
".$pathInfo[extension]."
";echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
相关文章
相关视频
下一篇: 国内手机号码匹配(2015年)