how to separate an array into different arrays and save them into db?

I am new here and I think @mozboz is correct on where to ask this question, but you have could loop through the array and explode the keys and use the last value to create the array you want.