I need help converting this code from this thread: How to Rotate a 2D Array of Integers
to PHP arrays.
int [,] newArray = new int[4,4];
for (int i=3;i>=0;--i) {
for (int j=0;j<4;++j) {
newArray[j,3-i] = array[i,j];
}
}
Also, will this code work if the blocks are off-center?