I have an array like so:
[5, 2, 9]
However, I need this array:
[0 => 5, 1 => 2, 2 => 9]
So I need the index as key. Is there a function to achieve this? Now I create an empty array manually and I use array_push through a foreach loop. It works, however this doesn't seem elegant.
Is there a better solution?