I have two arrays.
$all_labels = [
'data'=> [
['label'=> NULL],
['label'=> "C1.SNM"],
['label'=> "C1.SSM"],
['label'=> "C1.TAM"],
['label'=> "C1.TIM"],
['label'=> "C1.TNM"],
['label'=> "C1.TOM"]
]
];
$non_complianceData3 = [
'data'=> [
['label'=> "C1.TAM", 'value'=> "1674"],
['label'=> "C1.TOM", 'value'=> "574"]
]
];
I need the first array to act as the base, i.e. this returns all the labels available from the db. I then need to update the base by using the $non_complianceData3
array data values with the matching labels, in this case the base "C1.TAM"
needs to be updated with 'value'=> "1674"
, and the "C1.TOM"
with 'value'=> "574"
.
How do I go about doing this?