return two arrays from one
Posted: Tue Sep 02, 2008 11:59 am
Hey All,
I have a problem that I can't figure out and desperately need some help:
I have an array containing a month date and a post count:
Array ( [1] => 1 [4] => 3 [9] => 2 [10] => 2 [11] => 4)
What I want to do is split the array at the current month integer (9) and return 2 arrays to the left and right of the current month key i.e.
left = Array ( [1] => 1 [4] => 3)
right = Array ( [10] => 2 [11] => 4)
Any help would be greatly appreciated.
Thanks in advance,
Justin.
I have a problem that I can't figure out and desperately need some help:
I have an array containing a month date and a post count:
Array ( [1] => 1 [4] => 3 [9] => 2 [10] => 2 [11] => 4)
What I want to do is split the array at the current month integer (9) and return 2 arrays to the left and right of the current month key i.e.
left = Array ( [1] => 1 [4] => 3)
right = Array ( [10] => 2 [11] => 4)
Any help would be greatly appreciated.
Thanks in advance,
Justin.