I have a few different sets of data that go through a foreach loop. A lot of the code inside each foreach loop is similar, almost identical, but I'm using variables based on previously defined arrays as well as on that initial data put into the foreach loop. Is there a way to combine these loops into some sort of function without having to pass all of that data into the function?I have a few different sets of data that go thr