This question already has an answer here:
- Move elements using array_chunk with PHP 4 answers
I have array like below:
$matrix = array(1, 2, 1,1, 2, 1,1, 1, 1);
how can I get array like below?
//OUTPUT:
minesweeper(matrix) = [[1, 2, 1],
[2, 1, 1],
[1, 1, 1]]
</div>