php对二维索引数组进行重新排序
这有个二维索引数组:
$time_json = file_get_contents('./time.json');
$time_arr = json_decode($time_json,true);
unset($time_arr[1]);
print_r($time_arr);die;
想让该二维数组索引进行重新排序,该怎么办呢?array_values
完美解决这一问题:
$time_json = file_get_contents('./time.json');
$time_arr = json_decode($time_json,true);
unset($time_arr[1]);
$arr = array_values($time_arr);
print_r($arr);die;
在看: