Mecha CMS

$u_r_l->d()

Return the directory path relative to the server root if any, otherwise return null.

2.2.0

$u_r_l->d(void);
$u_r_l->d(string $join = '/');

Example:

$folder = strtr(ROOT, [
    GROUND . DS => "",
    DS => '/'
]);

$url = new URL('https://mecha-cms.com/foo/bar/1?baz=qux#asdf', '/' . $folder);

echo $url->d;