$_GET/$_POST array elements ordinal

115 Views Asked by At

I'm wondering if anyone can confirm the index (the ordinal position) of the $_GET/$_POST array elements reflects the original sequence the parameters were sent by the URL. In other words, if we look at the following URL containing the HTTP/GET:

http://www.example.com/test.php?a=123&b=453&c=xyz 

can we give for sure that the variables are stored in the $_GET in the same order? I mean, is it sure that:

$_GET[0]=123, $_GET[1]=453, $_GET[2]='xyz' ?

Obviously I'm aware that : $_GET['a']=123, $_GET['b']=453, and so on... but I want that the parameters are sent giving the freedom to choose the parameter name that for me is not relevant, what is important in my application is the position (sequence) in the $_GET/$_POST. The same with adequate changes for $_POST array. Any official statement?

1

There are 1 best solutions below

1
Emre Rothzerg On

I don't think there is an official statement of this but clearly $_GET is using $_SERVER['QUERY_STRING'] order (testing in multiple php versions)