Just skip all undefined array elements( like 0-4,6-9)
In my example above, the result should be 5=1&10=2&15=3, not 0=undefined&1=undefined...