I have an associative array with the following contents:
Array
(
[L_TIMESTAMP0] => 2011%2d10%2d16T16%3a57%3a38Z
[L_TIMESTAMP1] => 2011%2d10%2d16T16%3a45%3a23Z
[L_TIMESTAMP2] => 2011%2d10%2d16T16%3a35%3a54Z
[L_TIMEZONE0] => GMT
[L_TIMEZONE1] => GMT
[L_TIMEZONE2] => GMT
[L_STATUS0] => Completed
[L_STATUS1] => Completed
[L_STATUS2] => Completed
[TIMESTAMP] => 2011%2d10%2d16T17%3a58%3a39Z
)
What I want to do is to ‘group’ all instances of L_TIMESTAMP0, L_TIMEZONE0 and L_STATUS0 (and L_TIMESTAMP1, L_TIMEZONE1, L_STATUS1) into their own array, or as part of a multidimensional array. But I simply can’t seem to figure out how I would go about accomplishing this.
The expected results would be:
Array
(
[L_TIMESTAMP0] => 2011%2d10%2d16T16%3a57%3a38Z
[L_TIMEZONE0] => GMT
[L_STATUS0] => Completed
)
Array
(
[L_TIMESTAMP1] => 2011%2d10%2d16T16%3a45%3a23Z
[L_TIMEZONE1] => GMT
[L_STATUS1] => Completed
)
I figured this would be simple with a simple for-loop, but that doesn’t give me the results I’m looking for.
Any ideas?
It’s likely something very obvious, but I’ve spent the last few days with this and I can’t figure it out (although that probably says more about my skills than the problem)
edit:
To add; I don’t need the exact code for my particular question, but any pointers as to what direction I should look into would be greatly appreciated.
result