alexia\mar\main::getRealPath PHP Method

getRealPath() public static method

Get a full real path name to a given path.
public static getRealPath ( $path ) : mixed
return mixed File/Folder path or false on error.
    public static function getRealPath($path)
    {
        if (strpos($path, '~') === 0) {
            $path = substr_replace($path, $_SERVER['HOME'], 0, 1);
        }
        $_path = realpath($path);
        if (!empty($path) && $_path !== false) {
            return rtrim($_path, DIRECTORY_SEPARATOR);
        }
        return false;
    }