I am new to PHP and need some help with some simple looping logic.
I am reading the following data into an associative array and then looping through. I tried to use the next(array) function but this did not seem to work.
I need to find each of the first occurrence of 'L' and the next record where it is not an 'L' to calculate the sum total of date differences e.g. the first would be L=03-01-2001 and A=04-01-2001, and the next would be L= 06-01-2001 and A=09-01-2001.
A 01-01-2001
A 02-01-2001
L 03-01-2001
A 04-01-2001
A 05-01-2001
L 06-01-2001
L 07-01-2001
L 08-01-2001
A 09-01-2001
A 10-01-2001
A 11-01-2001