How to reindex an array in php

Tagged:  

If you have an array and want to reindex it to have the keys starting from 0 and be consecutive, you can use array_values, which does just that.

You can use it when lets say you want to iterate through it with a for (and not a foreach).