I want to insert a value in between an array. Both arrays are dynamically generated. Here are a sample code
$orig_array = Array
(
[r0] => Array
(
[c0] => Array
(
[field] => tab
[label] => First Name
[fieldid] => tab1
)
)
[r1] => Array
(
[c0] => Array
(
[field] => text
[label] => email
)
)
[r2] => Array
(
[c0] => Array
(
[field] => text
[label] => state
)
)
)
$insert_array = Array
(
[field] => text
[label] => First Name
[fieldid] => fname
[tabid] => tab1
)
Now I want to insert the 2nd array after the r1 node. There are 2 conditions for the 2nd array to be inserted at a particular position. 1. The field is tab field ( field = tab ) and 2. There is a tab id in 2nd array that should correspond to fieldid in first array.