When you reach the end of an array in a PHP foreach loop, is there anyway to just start from the beginning again?
I'm building a graph using JS and PHP of a group of different people. I would like to have a different colour for each person on the graph but the number of people varies and is unknown.
I've built an array of hex codes to loop through but the problem is that when the number of people exceeds the number of hex codes in the array an error is thrown.
I realised I could just copy and paste the hex codes until there are more than the number of people but it doesn't seem like a very elegant solution.
Any thoughts?