I have an array that has the following values: 1,1,3,5,1,1,3,5,1,1,3,5,1,1,3,5
You can easily look at this array and see that the pattern 1,1,3,5 repeats 4 times.
How would I make PHP figure this out for me?
Furthermore, my array may have more than one pattern that would need to be found.
For example, if the array were: 1,2,1,2,1,2,4,5,5,5
I would need to get output like "The pattern 1,2 repeats 3 times 4 repeats 1 time and 5 repeats 3 times."
Ultimately what I want to be able to do is upload a CSV file and parse it so that it is read in plain English.