URL::__toString()

Proxy for the current object, casted as a string.

Table of Contents
  1. Description
  2. Example

Description

URL::__toString(): string;

This method will be called when you cast a URL instance as a string.

Example

$url = new URL('http://127.0.0.1');
$url->path = 'foo/bar';
$url->port = 8080;
$url->query = 'foo=bar';

echo $url; // Returns `'http://127.0.0.1:8080/foo/bar?foo=bar'`

URL::__toString()

Proxy for the current object, casted as a string.

URL::current()

Returns the full URL address along with its query and hash.