I have an array nxm that I will call $tabela
.
This array has some data inside it organized as follows:
| Papel1 | Hora1 | Valor1 | Erro | B | | Papel2 | Hora2 | Valor2 | OK_Ok | A | | Papel3 | Hora3 | Valor3 | Falha | C | | Papel4 | Hora4 | Valor4 | OK_OK | A |
All table data is extracted from a mysql
table, except the last column that I enter in the array based on some conditions.
My question is, how to organize alphabetically all the rows of the array based on the last column? It would have to return this way:
| Papel2 | Hora2 | Valor2 | OK_Ok | A | | Papel4 | Hora4 | Valor4 | OK_OK | A | | Papel1 | Hora1 | Valor1 | Erro | B | | Papel3 | Hora3 | Valor3 | Falha | C |
Array ( [0] => Array ( [0] => MIL EUA [1] => 2018-03-05 14:00:13 [3] => 168.99 [2] => 2018-03-05 15:00:11 [4] => 168.99 [5] => Atraso entre os servidores de 59 minutos ) [1] => Array ( [0] => TRIGQQNP [1] => 2018-03-05 14:00:15 [3] => 3800.00 [2] => 2018-03-05 15:00:12 [4] => 3800.00 [5] => Atraso entre os servidores de 59 minutos ) )