I would like to ask how to print out this array with organize way
This is my array
> Array (
> [item1 under Category_1] => Category_1
> [item2 under Category_1] => Category_1
> [item3 under Category_2] => Category_2
> [item4 under Category_3] => Category_3
> [item5 under Category_3] => Category_3
> [item6 under Category_3] => Category_3
> [item7 under Category_3] => Category_3
> [item8 under Category_3] => Category_3 )
The output should like this:
Category_1
item1
item2
Category_2
item3
Category_3
item4
item5
item6
item7
item8
Is there any way I can do this? or my logic way to arrange my array is wrong?
My database table record is like this
category item
1 1
1 2
2 3
3 4
3 5
3 6
3 7
3 8
Anyone can help?