my head is starting to explode :(
I am trying to put index of array as a name of input and value of array as value of input. I simply need it to do this way :)
array named $arrAddItems which I go through is:
array(2) {
[0]=>
array(1) {
[479]=>
string(2) "83"
}
[1]=>
array(1) {
[345]=>
string(3) "348"
}
}
I need this output when form is submitted:
[345]=>
array(1) {
[0]=>
string(3) "348"
}
[479]=>
array(1) {
[0]=>
string(3) "83"
}
My code to do that is:
foreach($arrAddItems as $addItem) { echo key($addItem);?>
<input type="hidden" name="<?=key($addItem);?>[]" value="<?=$addItem;?>">
<?php
}
?>
I know it is something obvious, but I cannot see it :(
Thx for help. martin