/**
* 将数组的key恢复成数字序列
* @param $arr
* @return array
* @date 2020/8/6
*/
function restore_array($arr){
if (!is_array($arr)) {
return $arr;
}
$c = 0; $new = array();
foreach ($arr as $key => $value) {
if (is_array($value)){
$new[$c] = restore_array($value);
} else {
$new[$c] = $value;
}
$c++;
}
return $new;
}
原文链接:
https://www.jb51.net/article/65053.htm
参考其他文章:
https://www.cnblogs.com/richerdyoung/p/11765206.html
https://blog.csdn.net/chushuo9928/article/details/100772057