I need help converting this code from this thread: http://stackoverflow.com/questions/646468/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?