Overview

Namespaces

  • esperecyan
    • url
      • lib

Classes

  • URL
  • URLSearchParams
  • Overview
  • Namespace
  • Class
  • Tree

Class URLSearchParams

The URLSearchParams class defines utility methods to work with the query string of a URL.

esperecyan\url\URLSearchParams implements IteratorAggregate
Namespace: esperecyan\url
Link: URL Standard
Link: URLSearchParams - Web API Interfaces | MDN
Located at URLSearchParams.php
Methods summary
public
# __construct( string[][]|string[]|string|esperecyan\url\URLSearchParams $init = '' )

Parameters

$init

An array of two-element arrays with the first element the name and the second the value, associative array, USVString, or URLSearchParams.

Link

URL Standard
public
# append( string $name, string $value )

Appends a new name-value pair whose name is name and value is value, to the list of name-value pairs.

Appends a new name-value pair whose name is name and value is value, to the list of name-value pairs.

Parameters

$name
A USVString.
$value
A USVString.

Link

URL Standard
public
# delete( string $name )

Removes all name-value pairs whose name is name.

Removes all name-value pairs whose name is name.

Parameters

$name
A USVString.

Link

URL Standard
public string|null
# get( string $name )

Returns the value of the first name-value pair whose name is name, and null if there is no such pair.

Returns the value of the first name-value pair whose name is name, and null if there is no such pair.

Parameters

$name

Returns

string|null
A USVString or null.

Link

URL Standard
public string[]
# getAll( string $name )

Returns the values of all name-value pairs whose name is name, in list order, and the empty sequence otherwise.

Returns the values of all name-value pairs whose name is name, in list order, and the empty sequence otherwise.

Parameters

$name
A USVString.

Returns

string[]
An array of a USVString.

Link

URL Standard
public boolean
# has( string $name )

Returns true if there is a name-value pair whose name is name, and false otherwise.

Returns true if there is a name-value pair whose name is name, and false otherwise.

Parameters

$name
A USVString.

Returns

boolean

Link

URL Standard
public
# set( string $name, string $value )

If there are any name-value pairs whose name is name, set the value of the first such name-value pair to value and remove the others. Otherwise, append a new name-value pair whose name is name and value is value, to the list of name-value pairs.

If there are any name-value pairs whose name is name, set the value of the first such name-value pair to value and remove the others. Otherwise, append a new name-value pair whose name is name and value is value, to the list of name-value pairs.

Parameters

$name
A USVString.
$value
A USVString.

Link

URL Standard
public
# sort( string $name,…, string $value,… )

Sorts all name-value pair by their names and comparing JavaScript strings (UTF-16).

Sorts all name-value pair by their names and comparing JavaScript strings (UTF-16).

Parameters

$name,…
A USVString.
$value,…
A USVString.

Link

URL Standard
public
# getIterator( )

Uses

lib\URLSearchParamsIterator

Implementation of

IteratorAggregate::getIterator()
public string
# __toString( )

Returns the serialization of the URLSearchParams object's associated list of name-value pairs.

Returns the serialization of the URLSearchParams object's associated list of name-value pairs.

Returns

string
A USVString.

Link

URL Standard
esperecyan/url documentation API documentation generated by ApiGen