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:

Category 1 item 1 items 2 category_2 items 3 items 4 items 4 items 7 items 7 items 8 < / Code>

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

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -