Please consider the following simple test suite:
<?php
$data = file_get_contents('php://input');
echo '<pre>';
echo 'raw: <br/>';
print_r($data);
echo '<br/>$_POST: <br/>';
print_r($_POST);
echo '
<form name="form1" method="post" type="application/x-www-form-urlencoded" action="postTest.php"/>
<input type="text" name="my1[]" value="1" />
<input type="text" name="my1[]" value="2" />
<input type="text" name="my3" value="3 "/>
<input type="submit" />
</form>
This returns on most servers running PHP5+
raw:
my1%5B%5D=1&my1%5B%5D=2&my3=3+
$_POST:
Array
(
[my1] => Array
(
[0] => 1
[1] => 2
)
[my3] => 3
)
as expected. However on my local system with Ubuntu 12.10, Apache 2.2.22, PHP 5.4.6, locale tr_TR.UTF-8, it will return
raw:
my1%5B%5D=1&my1%5B%5D=2&my3=3+
$_POST:
Array
(
[my3] => 3
)
where my1 array is vanished. Please note that $_POST['my3'] is still there and I don't experience any other issue with non-array $_POST data and I can still see m1 is there from raw data. This is really strange behaviour. What could generally cause this issue?