Oihana PHP Enums

UrlComponent uses ConstantsTrait

Component keys of the associative array returned by PHP's `parse_url()` (and consumed when reassembling a URL).

Centralises the array keys so callers manipulating parse_url() output can avoid magic strings.

Tags
author

Marc Alcaraz

see
https://www.php.net/manual/en/function.parse-url.php
UriScheme

Table of Contents

Constants

FRAGMENT  : string = 'fragment'
The fragment, i.e. the part after the `#` (without the leading `#`).
HOST  : string = 'host'
The host name (e.g. `www.example.com`).
PASS  : string = 'pass'
The password from the userinfo part (`scheme://user:pass@host`).
PATH  : string = 'path'
The path (e.g. `/foo/bar`).
PORT  : string = 'port'
The port. Returned as an `int` by `parse_url()`, unlike the other components.
QUERY  : string = 'query'
The query string, i.e. the part after the `?` (without the leading `?`).
SCHEME  : string = 'scheme'
The URI scheme (e.g. `https`). See {@see UriScheme}.
USER  : string = 'user'
The user name from the userinfo part (`scheme://user:pass@host`).

Constants

FRAGMENT

The fragment, i.e. the part after the `#` (without the leading `#`).

public string FRAGMENT = 'fragment'

HOST

The host name (e.g. `www.example.com`).

public string HOST = 'host'

PASS

The password from the userinfo part (`scheme://user:pass@host`).

public string PASS = 'pass'

PATH

The path (e.g. `/foo/bar`).

public string PATH = 'path'

PORT

The port. Returned as an `int` by `parse_url()`, unlike the other components.

public string PORT = 'port'

QUERY

The query string, i.e. the part after the `?` (without the leading `?`).

public string QUERY = 'query'

SCHEME

The URI scheme (e.g. `https`). See {@see UriScheme}.

public string SCHEME = 'scheme'

USER

The user name from the userinfo part (`scheme://user:pass@host`).

public string USER = 'user'
On this page

Search results