I have an array of parameter values (with matching parameter names) in my request URL, like this:
?my_array_of_values=First&my_array_of_values=Second
In a Java servlet, I can detect them like this:
ServletRequest request = ...;
String[] myArrayOfValues = request.getParameterValues("my_array_of_values");
And this will result in:
myArrayOfValues[0] = "First";
myArrayOfValues1 = "Second";
...which is what I want.
However, I am not sure how to get the same results in PHP. For the same (above) parameters, when I try:
print_r($_GET);
it results in
Array ( [my_array_of_values] => Second )
...i.e., the "First" parameter is lost.
I can see why this happens, but is there a way to detect such an array of parameter values in PHP as you can in Java/servlets? If not, is there a recommended workaround or alternative way of doing it?