Normally I\'d be asking how to turn something like this:
1 2 3 4 5 6 7 8 9 10 11 12
Into this:
function flip_row_col_array($array) { $out = array(); foreach ($array as $rowkey => $row) { foreach($row as $colkey => $col){ $out[$colkey][$rowkey]=$col; } } return $out; }