i have an array with recurring values like
{1
2
3
4
5
6
7
8
9
10
11
12}
and another array with data
{itema
itemb
itemc
itemd}
i wan to split the first array and then to combine with second array that my output looks like ..
{
itema=>1,5,9
itemb=>2,6,10
itemc=>3,7,11
itemd=>4,8,12
}
i want to group the elements of array . Basically they are obtained using xpath and 4 values combine together to become information about a single subject. My basic purpose is to modify first array such that i can print values of same domain together…I want to print
1,2,3,4, 5,6,7,8 9, 10,11, 12
Question might look strange, but i am struggling to describ it completely…Sorry for that
Assuming the first array you talk of is a multi dimensional array, as in
What you need to do is loop through each array and create a new one in the process.
I haven’t tested the code myself, so I can’t say it’s perfect, but that’s basically what you want to do.
Feel free to ask questions.
Edit: As a result of a discussion, I found out that using the array chunk function did what the OP wanted, but not what the question asked.