I Need This Output..
1 3 5
2 4 6
I Want to use Array function like array(1,2,3,4,5,6). If i Edit this array like array(1,2,3) means the output need to show like
1 2 3
The concept is Maximum 3 Column only.If we give array(1,2,3,4,5) Means the output should be
1 3 5
2 4
Suppose we will give array(1,2,3,4,5,6,7,8,9) Means o/p is
1 4 7
2 5 8
3 6 9
Maximum 3 Column only.Depends upon the the given input the rows will be create with 3 column.Is This is Possible with PHP?Am Doing small Research & Development in Array Functions.I think this possible.Will you help me?
For more info:I/p :array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
O/P:
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
Getting number of rows is as easy as ceiling(total number of elements / elements per row). All you need to do is to copy the elements from one one-dimensional array to an other two-dimensional array. One possible method:
Output