Switching arrays

I have a 2-dimensional array, let’s call it array1, and I want it to become array2. I tried simply writing array1 = array2, but it doesn’t work properly. I was told by someone that I have to replace array 1 one value at a time into array2 with a for loop. Does anyone know how to do this? Also, what do I do if the arrays are different sizes? ex. array1 = 5x10, array2 = 6x8