php print array using nested foreach -
How would I like to print this array with the way to organize this way
this is my The array is
& gt; [Category5] = & gt; Category_1 & gt; [Item 2] under category 1 = & gt; Category 1 & gt; [Item 3] under category 4 = & gt; Category_2 & gt; [Item 4] under category 4 = & gt; Category_3 & gt; [Item under item 5] = & gt; Category_3 & gt; [Item 6] under category 7 = & gt; Category_3 & gt; [Item 7 under category 7] = & gt; Category_3 & gt; [Item 8] under category 8 = & gt; Category_3)
Output should like this:
Is there any way I can do that? Or the method of my argument is wrong to organize my array?
My database table record is like this
category item 1 1 2 2 3 3 4 3 5 3 6 3 7 3 8
< P> Can anyone help?
You probably need to adjust the layout and line breaks, but I think that you get this idea Receives:
Esport ($ your_array); Forex Currency ($ your_array $ key = & gt; $ value) {if ($ key_temp! = $ Of) {echo $ key "\ R \ n"; } Echo "". $ Value "\ R \ n"; $ Key_temp = $ key; }
Comments
Post a Comment