Mecha CMS

$u_r_l->path()

Return the URL path if any, otherwise return null.

2.2.0

$u_r_l->path(void);
$u_r_l->path(string $join = '/');
$u_r_l->path(string $join = '/', array $lot = []);

Example:

$url = new URL('https://mecha-cms.com/foo/bar/1');

$A = $url->path;
$B = $url->path();
$C = $url->path('\\');
$D = $url->path('\\', [1 => '#']);

Result:

$A = '/foo/bar';
$B = '/foo/bar';
$C = '\foo\bar';
$D = '\foo\#';