I have two functions which appear to be slowing down PHP, and I believe its to do with the use of array_merge in the loops, only I am struggling to figure out how I can get arou