PHP 5.6.16 is available


(PECL pecl_http >= 0.22.0)

HttpQueryString::__constructConstructor de HttpQueryString


final public HttpQueryString::__construct ([ bool $global = true [, mixed $add ]] )

Crea una nueva instancia de un objeto HttpQueryString.

Siempre que global está a TRUE, actualiza y usa las variables $_GET y $_SERVER['QUERY_STRING'].



define si se opera sobre $_GET o sobre $_SERVER['QUERY_STRING']


parámetros adiciones/iniciales de la cadena de consulta


Lanza HttpRuntimeException.

add a note add a note

User Contributed Notes 1 note

michal dot kocarek at brainbox dot cz
6 years ago
Note about first argument when calling the constructor:
– if true, instance will have initially exactly same query string as PHP received when user accessed the page
– if false, instance will be empty.

// Imagine that user puts "test.php?name=JamesBond&age=30" into browser, then…

$query = new HttpQueryString(); // query is "name=JamesBond&age=30". (First argument is true by default.)
$query = new HttpQueryString(false); // query is empty
$query = new HttpQueryString(true, 'age=31'); // query is "name=JamesBond&age=31", name was preserved, age was updated
$query = new HttpQueryString(false, 'age=31'); // query is "age=31"

Second argument can be string and associative array, same as for HttpQueryString->set() method.
To Top