URL::offsetUnset()

Deletes a URL data.

Table of Contents
  1. Description
  2. Example

Description

URL::offsetUnset(mixed $key): void;

This method is a requirement to be able to implement the ArrayAccess interface and aims to make the object data modifiable using array access syntax. You won’t use this method directly, it will be executed automatically when you try to delete a URL data with array access syntax.

Example

$url = new URL('http://127.0.0.1:8080/foo/bar/baz?foo=bar#baz');

$url['port'] = null;
unset($url['query']);

test($url->current); // Returns `'http://127.0.0.1/foo/bar/baz#baz'`

URL::current()

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

URL::offsetUnset()

Deletes a URL data.