html - Set three divs on one line from PHP foreach -


The force cycle of my HP script generates a div element (product information and 270px width of image) in a big element (width 900px).

How to do this?

I appreciate any help!

In addition to all the solutions, another way to achieve it. If you are looking at the solution from the Fourth loop you can break the array using.

  & lt ;? Php $ array = array (1, 2, 3, 4, 5, 6, 7, 8, 9); // It will be part of the array in 3,3 values. $ NewArray = array_chunk ($ array, 3, true); Forex Currency ($ new array $ $ value) {echo '& lt; Div class = "separator" & gt; '; // Intranet Inner Arrangements Foreign Currency ($ Value $ as Internal Value) {echo $ innerValue, '; } Echo & lt; / Div & gt; '; }  

Output: - Now in the divider div, 3 divis will be displayed.

  & lt; Div class = "separator" & gt; 1,2,3, & lt; / Div & gt; & Lt; Div class = "separator" & gt; 4,5,6, & lt; / Div & gt; & Lt; Div class = "separator" & gt; 7,8,9, & lt; / Div & gt;  


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -