Mecha CMS

Path::D()

Convert file path to its directory path.

2.0.0 Static

Path::D(string $value, int $step = 1, string $join = DS);

Example:

$A = Path::D('foo\bar\baz.qux');
$B = Path::D('foo\bar\baz.qux', 2);
$C = Path::D('foo-bar-baz.qux', 1, '-');
$D = Path::D('foo.bar.baz.qux', 1, '.');

Result:

$A = 'foo\bar';
$B = 'foo';
$C = 'foo-bar';
$D = 'foo.bar.baz';