php RemoveFromStart类(方法)实例源码

下面列出了php RemoveFromStart 类(方法)源码代码实例,从而了解它的用法。

作者:Raak1    项目:subtitol   
function ServerMapFolder($resourceType, $folderPath)
{
    // Get the resource type directory.
    $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . strtolower($resourceType) . '/';
    // Ensure that the directory exists.
    CreateServerFolder($sResourceTypePath);
    // Return the resource type directory combined with the required path.
    return $sResourceTypePath . RemoveFromStart($folderPath, '/');
}

作者:LFS    项目:ora   
function ServerMapFolder($resourceType, $folderPath)
{
    // Get the resource type directory.
    //	$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '\\' ;
    $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '/';
    // Ensure that the directory exists.
    CreateServerFolder($sResourceTypePath);
    // Return the resource type directory combined with the required path.
    //	return $sResourceTypePath . str_replace( '/', '\\', RemoveFromStart( $folderPath, '/' ) ) ;
    return $sResourceTypePath . RemoveFromStart($folderPath, '/');
}

作者:lonelywool    项目:hyperv   
function ServerMapFolder($resourceType, $folderPath)
{
    // Get the resource type directory.
    $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . strtolower($resourceType) . '/';
    // Ensure that the directory exists.
    $sErrorMsg = CreateServerFolder($sResourceTypePath);
    if ($sErrorMsg != '') {
        if (isset($GLOBALS['HeaderSent']) && $GLOBALS['HeaderSent']) {
            SendErrorNode(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})");
            CreateXmlFooter();
            exit;
        } else {
            SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})");
        }
    }
    // Return the resource type directory combined with the required path.
    return $sResourceTypePath . RemoveFromStart($folderPath, '/');
}

作者:golfcrseve    项目:scsupe   
function CombinePaths($sBasePath, $sFolder)
{
    return RemoveFromEnd($sBasePath, '/') . '/' . RemoveFromStart($sFolder, '/');
}


问题


面经


文章

微信
公众号

扫码关注公众号