Q:

How to reorder array indexes in PHP?

I have an array as follows:
Array
(
        [0] => value1
        [1] => value2
        [2] => value3
        [3] => value4
        [4] => value5
        [5] => value6
)

Now somehow I need to unset a specific key from that array and I do that by using unset. Let us suppose I removed or unset index 1. Then after removing that index I have following array:
Array
(
        [0] => value1
        [2] => value3
        [3] => value4
        [4] => value5
        [5] => value6
)

Now when I loop over that array again then I will get undefined index 1 error. I want to ask is there any way that I can reorder this array again so that indexes are ordered? And array looks like below after deletion followed by reordering:
Array
(
        [0] => value1
        [1] => value3
        [2] => value4
        [3] => value5
        [4] => value6
)

P.S: I am getting error because I am using for loop and don't want to use foreach loop because of complexity of problem. The actual code for the problem is much difficult and messy to understand that is why I created dummy one dimensional array in my question to ask specifically what is the problem.
So please post only those solutions after which I am able iterate over same array using for loop rather than foreach. 
Many thanks. 

A:

array_values should do the work:
$new_array = array_values($old_array);

