can you help me with looping problem in php? I've been confused for hours because I don't understand deeply
so I have an array data like the following.
array (size=3)
0 =>
array (size=8)
'Label 1' => int 1
'Label 2' => int 0
'Label 3' => int 0
'Label 4' => int 0
'Label 5' => int 0
'Label 6' => int 0
'Label 7' => int 1
'Label 8' => int 0
1 =>
array (size=8)
'Label 1' => int 0
'Label 2' => int 0
'Label 3' => int 1
'Label 4' => int 0
'Label 5' => int 1
'Label 6' => int 1
'Label 7' => int 0
'Label 8' => int 0
2 =>
array (size=8)
'Label 1' => int 0
'Label 2' => int 1
'Label 3' => int 0
'Label 4' => int 1
'Label 5' => int 0
'Label 6' => int 0
'Label 7' => int 0
'Label 8' => int 1
and I want to create a table that looks like the this.
| Lable | Groups |
|---|---|
| Label 1 | C1 |
| Label 2 | C3 |
| Label 3 | C2 |
| Label 4 | C3 |
| Label 5 | C2 |
| Label 6 | C2 |
| Label 7 | C1 |
| Label 8 | C3 |
Where array 0.1,2 will be used to identify C1, C2, C3. so
array 0 = C1
array 1 = C2
array 2 = C3
Aucun commentaire:
Enregistrer un commentaire