yii\helpers\BaseStringHelper::dirname PHP 메소드

dirname() 공개 정적인 메소드

This method is similar to dirname() except that it will treat both \ and / as directory separators, independent of the operating system.
또한 보기: http://www.php.net/manual/en/function.basename.php
public static dirname ( string $path ) : string
$path string A path string.
리턴 string the parent directory's path.
    public static function dirname($path)
    {
        $pos = mb_strrpos(str_replace('\\', '/', $path), '/');
        if ($pos !== false) {
            return mb_substr($path, 0, $pos);
        } else {
            return '';
        }
    }