I have a multidimensional php array that represents a table like this
-------------
| A | 0 | A |
|---|---|---|
| 0 | 0 | 0 |
|---|---|---|
| A | 0 | A |
-------------
so the array looks like this:
array (size=3)
0 =>
array (size=3)
0 => string 'A' (length=1)
1 => string '0' (length=1)
2 => string 'A' (length=1)
1 =>
array (size=3)
0 => string '0' (length=1)
1 => string '0' (length=1)
2 => string '0' (length=1)
2 =>
array (size=3)
0 => string 'A' (length=1)
1 => string '0' (length=1)
2 => string 'A' (length=1)
Now i want to delete the second row and the second column (this is just a simplified example btw).
Deleting the row is easy:
array_splice($array, 1, 1);
I found this approach but was wondering if there was a simpler way (similar to the row) of deleting the column as well? Maybe transposing the array first?