class HttpQueryString implements Serializable, ArrayAccess (View source)

Constants

TYPE_BOOL

TYPE_INT

TYPE_FLOAT

TYPE_STRING

TYPE_ARRAY

TYPE_OBJECT

Methods

__construct(bool $global = null, mixed $add = null)

(PECL pecl_http >= 0.22.0)
HttpQueryString constructor

array
toArray()

(PECL pecl_http >= 0.22.0)
Get query string as array

string
toString()

(PECL pecl_http >= 0.22.0)
Get query string

string
__toString()

No description

mixed
get(string $key = null, mixed $type = null, mixed $defval = null, bool $delete = null)

(PECL pecl_http >= 0.22.0)
Get (part of) query string

string
set(mixed $params)

(PECL pecl_http >= 0.22.0)
Set query string params

mod(mixed $params)

(PECL pecl_http >= 1.1.0)
Modifiy query string copy

getBool($name, $defval, $delete)

No description

getInt($name, $defval, $delete)

No description

getFloat($name, $defval, $delete)

No description

getString($name, $defval, $delete)

No description

getArray($name, $defval, $delete)

No description

getObject($name, $defval, $delete)

No description

static 
factory($global, $params, $class_name)

No description

static HttpQueryString
singleton(bool $global = null)

(PECL pecl_http >= 0.25.0)
HttpQueryString singleton

bool
xlate(string $ie, string $oe)

(PECL pecl_http >= 0.25.0)
Change query strings charset

string|null
serialize()

String representation of object

mixed
offsetGet(TKey $offset)

Offset to retrieve

void
unserialize(string $serialized)

Constructs the object

bool
offsetExists(TKey $offset)

Whether a offset exists

void
offsetSet(TKey $offset, TValue $value)

Offset to set

void
offsetUnset(TKey $offset)

Offset to unset

Details

final __construct(bool $global = null, mixed $add = null)

(PECL pecl_http >= 0.22.0)
HttpQueryString constructor

Parameters

bool $global

[optional]

whether to operate on $_GET and $_SERVER['QUERY_STRING']

mixed $add

[optional]

additional/initial query string parameters

array toArray()

(PECL pecl_http >= 0.22.0)
Get query string as array

Return Value

array

the array representation of the query string.

string toString()

(PECL pecl_http >= 0.22.0)
Get query string

Return Value

string

the string representation of the query string.

string __toString()

No description

Return Value

string

mixed get(string $key = null, mixed $type = null, mixed $defval = null, bool $delete = null)

(PECL pecl_http >= 0.22.0)
Get (part of) query string

Parameters

string $key

[optional]

key of the query string param to retrieve

mixed $type

[optional]

which variable type to enforce

mixed $defval

[optional]

default value if key does not exist

bool $delete

[optional]

whether to remove the key/value pair from the query string

Return Value

mixed

the value of the query string param or the whole query string if no key was specified on success or defval if key does not exist.

string set(mixed $params)

(PECL pecl_http >= 0.22.0)
Set query string params

Parameters

mixed $params

query string params to add

Return Value

string

the current query string.

HttpQueryString mod(mixed $params)

(PECL pecl_http >= 1.1.0)
Modifiy query string copy

Parameters

mixed $params

query string params to add

Return Value

HttpQueryString

a new HttpQueryString object

getBool($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

getInt($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

getFloat($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

getString($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

getArray($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

getObject($name, $defval, $delete)

No description

Parameters

$name
$defval [optional]
$delete [optional]

static factory($global, $params, $class_name)

No description

Parameters

$global [optional]
$params [optional]
$class_name [optional]

static HttpQueryString singleton(bool $global = null)

(PECL pecl_http >= 0.25.0)
HttpQueryString singleton

Parameters

bool $global

[optional]

whether to operate on $_GET and $_SERVER['QUERY_STRING']

Return Value

HttpQueryString

always the same HttpQueryString instance regarding the global setting.

bool xlate(string $ie, string $oe)

(PECL pecl_http >= 0.25.0)
Change query strings charset

Parameters

string $ie

input encoding

string $oe

output encoding

Return Value

bool

true on success or false on failure.

string|null serialize()

Since: 5.1.0

String representation of object

Return Value

string|null

The string representation of the object or null

mixed offsetGet(TKey $offset)

Since: 5.0.0

Offset to retrieve

Parameters

TKey $offset

The offset to retrieve.

Return Value

mixed

Can return all value types.

void unserialize(string $serialized)

Since: 5.1.0

Constructs the object

Parameters

string $serialized

The string representation of the object.

Return Value

void

bool offsetExists(TKey $offset)

Since: 5.0.0

Whether a offset exists

Parameters

TKey $offset

An offset to check for.

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

void offsetSet(TKey $offset, TValue $value)

Since: 5.0.0

Offset to set

Parameters

TKey $offset

The offset to assign the value to.

TValue $value

The value to set.

Return Value

void

void offsetUnset(TKey $offset)

Since: 5.0.0

Offset to unset

Parameters

TKey $offset

The offset to unset.

Return Value

void