how to add multidimensional array values ​whose values ​are from different arrays

I have been fighting with this all day and would like another set of eyes to maybe give me some insight. I’m not sure I am even approaching this the correct way. I have two arrays, namely a multidimensional array and a single array, I am trying to add up the contents of a multidimensional array whose values ​​are taken from a single array, where the contents of the multidimensional array are the same as the array keys of a single array. I’m building an app with Laravel.