I have a bidimensional PHP array (matrix).
Is there anyway to extract (echo or save into another variable) a line or a column from this matrix without iterating through the elements?
Suppose we have this matrix:
A A A B
A A A C
A B C D
I want to do something like:
display_and_cut_first_line()
//Matrix after this step:
A A A C
A B C D
display_and_cut_last_column()
//Matrix after this step:
A A A
A B C
It only has to work for marginal elements (first/last line, first/last column). I was thinking of somehow using slice, but didn't manage to do it.