PHP | Remove element from array with reordering?
If you are always removing the first element, then use array_shift() instead of unset().
Otherwise, you should be able to use something like $a = array_values($a).
array_values($c)
will return a new array with just the values, indexed linearly.