Is there an easy way to expand out a list to individual components? E.g. if a client requests the following lines: 1,5,6,10-15,20,21 is there an easy way using PHP (or MySQL directly) to convert this to a list of: 1,5,6,10,11,12,13,14,15,20,21.
I am thinking I can move each element into an array and then look for the '-' character in an 'a-b' component and use that to run a loop process to add numbers from 'a' through to 'b' but there may be an easier way.