I would like to "mirror" (like seen in a mirror) a 2-d array. The array looks like that:
array1 = [
['a','b','c'],
['d','e','f'],
['g','h','i'],
['j','k','l']
];
I'd like to create a new array which values "mirror" the first array values, like that:
array2 = [
['a','e','i'],
['b','f','j'],
['c','g','k'],
['d','h','l']
];
Been trying a couple of thing with reverse() but I cannot find a solution.
Edit: in this case "mirror" means something similar to Cramer's Rule: http://www.1728.org/cramer4d.png (see diagonals)
Edit: My bad, I should have copy-proofed my post. The second array should like:
array2 = [
['a','d','g','j'],
['b','e','h', 'k'],
['c','f','i', 'l']
];