PHP uses []
in query parameter names to ensure that multiple occurrences of a parameter are all present in $_GET
superglobal variable. (Otherwise only last occurrence is present.) (Any other software does that?)
But from RFC 3986 (and others as well) it seems that neither [
nor ]
are allowed in query string.
Yet my experiments with various browsers suggested that no browser encodes those characters and they are there in the URI just like that...
Is this real life practice? Or am I testing it incorrectly? I tested with PHP 5.3.17 on IIS 7. Using Internet Explorer, Firefox and Chrome. Then I compared what is in $_SERVER['QUERY_STRING']
and $_GET
.