public static function dirname($path) { $pos = mb_strrpos(str_replace('\\', '/', $path), '/'); if ($pos !== false) { return mb_substr($path, 0, $pos); } else { return ''; } }