Php divides an array into five groups. Suppose $ list is a group of arrays. Contains multiple data records.
I want to divide $ list into five groups and then output them.
In the template output loop, each group ::
{Loop $ XXXX $ x} is the X group: $ A $ B $ C2 $ A $ B $ C3 $ A $ B $ C3 $ A $ B $ C4 $ A $ B $ C5 $ A $ B $ C2 $ C {/loop}
It is estimated that the first in two cycles is the total number of entries, and the second is the five in each loop.
Reply to discussion (solution)
Output:
12345678901
Output:
12345678901
All of these calls come out. how do I call the first group? How to Call Group 1 Will be traversed, not enumerated?
$ A = array_chunk (array (1, 3, 4, 5, 7, 8, 9, 0, 1), 5 );
Print_r ($ a [0]);
Will be traversed, not enumerated?
$ A = array_chunk (array (1, 3, 4, 5, 7, 8, 9, 0, 1), 5 );
Print_r ($ a [0]);
For example, I only want the template output. of course, there are no numbers in the template code.
Similar
{Loop $ xxx $ xx}
This is group X: $ a/$ B/$ c
{/Loop}
The result is like
This is the 1st Group: 1/2/3
This is the 2nd group: 4/5/6
This is the 3rd Group: 7/8/9
...............
Of course, I don't know how many groups I have. Since a template is used, data must be transmitted as required by the template.