Method dirname() Method dirname string dirname(string path) Description Returns all but the last segment of a path. Some example inputs and outputs: ExpressionValue dirname("/a/b")"/a" dirname("/a/")"/a" dirname("/a")"/" dirname("/")"/" dirname("")"" See also basename(), explode_path()