I tryed to do something like this:
function rotate90($mat) { $n = count($mat); $m = count($mat[0]); $mat90=array(); for ($i