<?php $arr = array('0' => '1', '1' => '2', '2' => '3'); $arr2 = array_keys($arr); print_r($arr2);
Array ( [0] => 0 [1] => 1 [2] => 2 )