You follow the same procedure 3 times:

1. call range()
2. call array_combine
3. unshift something
4. createSelect

Maybe create a function for that?