I have two arrays. Array 1 is a mapping between DeptID and dept_number:
array(66) {
[0] => array(2) {
'DeptID' → str•4 '1300'
'dept_number' → str•3 '18'
}
[1] => array(2) {
'DeptID' → str•4 '1000'
'dept_number' → str•3 '129'
}
[2] => array(2) {
'DeptID' → str•4 '2400'
'dept_number' → str•3 '101'
}
...and so on
Array 2 has store records which include dept_number. I want to replace the dept_number value with the DeptID value from Array 1.
array(27) {
[0] => array(11) {
'org_id' → str•2 '11'
'org_number' → str•2 '11'
'supplier_number' → str•4 '3806'
'supplier_name' → str•17 'TEST1'
'invoice_number' → str•8 'DXXX'
'receive_date' → str•10 '2013-09-11'
'inv_status' → str•7 'Pending'
'final_cost' → str•6 '317.30'
'final_qty' → str•5 '12.00'
'dept_number' → str•2 '18'
'dept_descr' → str•10 'BULK 1'
}
[1] => array(11) {
'org_id' → str•2 '11'
'org_number' → str•2 '11'
'supplier_number' → str•4 '1070'
'supplier_name' → str•24 'TEST2'
'invoice_number' → str•7 'DXXY'
'receive_date' → str•10 '2013-09-11'
'inv_status' → str•7 'Pending'
'final_cost' → str•6 '830.30'
'final_qty' → str•5 '26.00'
'dept_number' → str•2 '101'
'dept_descr' → str•10 'BULK 2'
}
...and so on
How do I replace the dept_number in Array 2 with the DeptID from Array 1?