Monday, 9 September 2013

PHP - Returning sub arrays based on 2 indices from another array

PHP - Returning sub arrays based on 2 indices from another array

I'm experimenting with PHP and I was wondering if there is a simple way to
accomplish this:
If $array1 = ('A', 'B', '$', 'C', 'D', 'E', '%', 'F', 'G', 'H', 'I', '&',
'J') and $array2 =('$', '%', '&') how can I get 4 separate arrays that are
between the delimiters defined in array2? In other words, I should get 4
arrays that contain ('A', 'B'), ('C', 'D', 'E'), ('F', 'G', 'H', 'I') and
('J').

No comments:

Post a Comment