URL::__serialize()

Provides data to be serialized.

Table of Contents
  1. Description
  2. Example

Description

URL::__serialize(): array;

This method will be called when a URL instance is serialized using the built-in PHP serialize() function.

Example

$url = new URL('http://127.0.0.1/a/b?c=d#e');

echo serialize($url); // Returns `'O:3:"URL":1:{s:3:"lot";a:6:{s:4:"hash";s:1:"e";s:4:"host";s:9:"127.0.0.1";s:4:"path";s:3:"a/b";s:4:"port";N;s:8:"protocol";s:4:"http";s:5:"query";s:3:"c=d";}}'`

URL::__serialize()

Provides data to be serialized.

URL::current()

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