Basically, I have manipulate an array using :
$block = array_count_values(array_column($modelLokasi, 'block'));
The result like this,
[
'A1' => 14
'A2' => 13
'A3' => 20
'A9' => 7
'B7' => 11
'C1' => 7
'C2' => 10
'C3' => 15
'C4' => 11
'C6' => 12
'C7' => 8
'D7' => 31
'E1' => 23
'E2' => 30
'E3' => 20
'E4' => 28
'E7' => 12
'F7' => 1
'G1' => 2
'G2' => 10
'G3' => 18
'G4' => 21
'G5' => 1
'G6' => 1
'G7' => 10
'H7' => 11
'I1' => 8
'I2' => 13
'I3' => 16
'I4' => 17
'I5' => 12
'I6' => 15
'I7' => 11
'K0' => 28
'K1' => 21
'K2' => 2
'K7' => 36
]
How to find max first character in keys and max second character in keys.
I mean max_first_character is = K in k7 and max_second_character = 9 in A9 ?
Because I need to display it like this :
| A | B | C | .... | K |
1| 14 | 0 | |
2| 13 |''''''''''''''''''''| |
3| 20 |''''''''''''''''''''| |
4| 0 |''''''''''''''''''''| |
5| 0 |''''''''''''''''''''| |
6| 0 |''''''''''''''''''''| |
7| 0 |''''''''''''''''''''| 36 |
8| 0 |''''''''''''''''''''| |
9| 7 |''''''''''''''''''''| |
Please advise.