php获得网站根目录
作者:admin 日期:2011-05-11
function GetRootPath()
{
$sRealPath = realpath( './' ) ;
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
}
评论: 0 | 引用: 0 | 查看次数: 5644
发表评论
广告位