Give that array
I want to use the random string attached to the tab-title and tab content keys which are rEXMp and 3T2IV respectively , I want to use those to split the array into two arrays and getting rid of these characters in the new array and also add the cell_nums and grid_num and cell_weight which are directly following the end of the key to the same array
Array
(
[0] => Array
(
[tab-title-rEXMp] => tab-1
)
[1] => Array
(
[tab-content-rEXMp] => tab-1 content
)
[2] => Array
(
[tab-title-rEXMp] => tab-2
)
[3] => Array
(
[tab-content-rEXMp] => tab-2 content
)
[4] => Array
(
[tab-title-rEXMp] => tab-3
)
[5] => Array
(
[tab-content-rEXMp] => tab-3 content
)
[6] => Array
(
[cells_num] => 1
)
[7] => Array
(
[grid_num] => 0
)
[8] => Array
(
[cell_weight] => 100%
)
[9] => Array
(
[tab-title-3T2IV] => tab-4
)
[10] => Array
(
[tab-content-3T2IV] => tab-4 content
)
[11] => Array
(
[tab-title-3T2IV] => tab-5
)
[12] => Array
(
[tab-content-3T2IV] => tab-5 content
)
[13] => Array
(
[tab-title-3T2IV] => tab-6
)
[14] => Array
(
[tab-content-3T2IV] => tab-6 content
)
[15] => Array
(
[cells_num] => 1
)
[16] => Array
(
[grid_num] => 1
)
[17] => Array
(
[cell_weight] => 100%
)
)
I wanna output something like
Array(
0 => Array(
[tabs] => Array(
0 => Array(
'tab-title' => 'tab-1',
'tab-content' => 'tab-1 content'
),
1 => Array(
'tab-title' => 'tab-2',
'tab-content' => 'tab-2 content'
),
2 => Array(
'tab-title' => 'tab-3',
'tab-content' => 'tab-3 content'
)
),
cells_num => 0,
cell_weight => 100%,
grid_num => 0
),
1=> Array(
[tabs] => Array(
0 => Array(
'tab-title' => 'tab-4',
'tab-content' => 'tab-4 content'
),
1 => Array(
'tab-title' => 'tab-5',
'tab-content' => 'tab-5 content'
),
2 => Array(
'tab-title' => 'tab-6',
'tab-content' => 'tab-6 content'
)
),
cells_num => 0,
cell_weight => 100%,
grid_num => 1
)
)
any help will be appreciated :)