I know that post is too old but since it is in google's result for the keyword 'php reset array keys' I have decided to add the solution to help others
The first idea which came to my mind was this:
PHP Code:
$threads = array('10'=>'one', '2'=>'two', '15'=>'three');
$keys = range(0, count($threads)-1);
$values = array_values($threads);
$threads = array_combine($keys, $values);
but later I have discovered that there is even more simple way
PHP Code:
$threads = array('10'=>'one', '2'=>'two', '15'=>'three');
$threads = array_values($threads);
Good luck with your script