Mecha CMS

$u_r_l->__toString()

Treat URL object as string.

2.0.0

$u_r_l->__toString(void);

Example:

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

echo $A;
echo $B;

Result:

https://mecha-cms.com
https://mecha-cms.com/foo