plz anyone help me. I want to merge the subarrays. I have associative array to merge in php like below.but the arrays were flatter. I tried to adapt the code, but unfortunately without success. Here my example :
Array(
[0] => Array(
[1] => Array(
[pid] => 1278
[price] => 30
)
[2] => Array (
[pid] => 1279
[price] => 300
)
)
[1] => Array (
[1] => Array (
[pid] => 1280
[price] => 120
)
[2] => Array (
[pid] => 1281
[price] => 250
)
)
And i have to Generate like below.
Array (
[1] => Array (
[pid] => 1278
[price] => 30
)
[2] => Array (
[pid] => 1279
[price] => 300
)
[3] => Array (
[pid] => 1280
[price] => 120
)
[4] => Array (
[pid] => 1281
[price] => 250
)
)
$newvar = $array[0];