I have a strange problem. I recently migrated my application from my local xampp installation to a SUSE Enterprise Server 11 and everything is working but this one thing drives me crazy and I can't find a solution.
When passing arrays either through GET or POST using this syntax:
search_dggs.php?latmin[]=52.447529&latmin[]=22&lonmin=17.56&lonmax=22.16
I only get the first element of latmin. Mind you that this is only a simple example I tried after the error occurred in other places where the passing of arrays is necessary.
print_r($_SERVER["QUERY_STRING"]);
outputs
latmin[]=52.447529&latmin[]=22&lonmin=17.56&lonmax=22.16
but
print_r($_GET);
gives
Array
(
[latmin] => Array
(
[0] => 52.447529
)
[lonmin] => 17.56
[lonmax] => 22.16
)
Exactly the same happens with all POST requests.
I'm using PHP Version 5.3.8. I guess the problem is some Server configuration but I couldn't find anything about this problem.
Response to comments:
The same happens if I submit any number of variables.
parse_str($_SERVER["QUERY_STRING"]);
print_r($latmin);
gives
Array
(
[0] => 52.447529
)
php.ini can be found here
You should be able to see the behaviour in action here
The source file of this php file is
<?php
$test="latmin[]=52.447529&latmin[]=22&lonmin=23&lonmax=22.16";
parse_str($test);
print_r($latmin);
phpinfo();
?>