I could not reproduce this on the latest 12.04 with PHP 5.3.10-1ubuntu3 using a basic libapache2-mod-php5 setup.
_POST comes out as
Array ( [text1] => Array ( [fname] => a [lname] => b [text3] => Array ( [text] => c )
[text4] => Array ( [text] => d )
)
[submit1] => submit )
Given this script (combines the HTML with the result so you can keep trying values):
<html> <body> <?php
$inputdata = file_get_contents( 'php://input' ); print_r($inputdata); echo '<pre>'; print_r($_POST); echo '</pre>';
$test_array = array ( 'test1' => array( 'test11' => 'test','test12' => 'test','test13' => array( 'test131' => 'test') ) ); echo '<pre>'; var_export($test_array); echo '</pre>'; ?> <form method="post">
First Name: <input type="text" id="fname" name="text1[fname]"></input> <br/><br/> Last name: <input type="text" id="lname" name="text1[lname]"></input> <br/><br/>
text3: <input type="text" id="fname" name="text1[text3][text]"></input> <br/><br/> text4: <input type="text" id="lname" name="text1[text4][text]"></input> <br/>
<br/> <input name="submit1" type="submit" value="submit"></input>
</form>
</body> </html>
I could not reproduce this on the latest 12.04 with PHP 5.3.10-1ubuntu3 using a basic libapache2-mod-php5 setup.
_POST comes out as
Array
[ text] => c
(
[text1] => Array
(
[fname] => a
[lname] => b
[text3] => Array
(
)
[text4] => Array
[ text] => d
(
)
)
[submit1] => submit
)
Given this script (combines the HTML with the result so you can keep trying values):
<html>
<body>
<?php
$inputdata = file_get_contents( 'php://input' ); $inputdata) ;
print_r(
echo '<pre>';
print_r($_POST);
echo '</pre>';
$test_array = array ( 'test1' => array( 'test11' => 'test','test12' => 'test','test13' => array( 'test131' => 'test') ) ); $test_array) ;
echo '<pre>';
var_export(
echo '</pre>';
?>
<form method="post">
First Name: <input type="text" id="fname" name="text1[ fname]" ></input> lname]" ></input>
<br/><br/>
Last name: <input type="text" id="lname" name="text1[
<br/><br/>
text3: <input type="text" id="fname" name="text1[ text3][ text]"> </input> text4][ text]"> </input>
<br/><br/>
text4: <input type="text" id="lname" name="text1[
<br/>
<br/> submit" ></input>
<input name="submit1" type="submit" value="
</form>
</body>
</html>