时间:2021-07-01 10:21:17 帮助过:5人阅读
$a = array(0, 1, 2, 3);$b = range(1, count($a));$c = array_combine($b, $a);print_r($c);Array
$arr = array(0,1,2,3);$temp = array();foreach($arr as $k=>$v){ $k++; $temp[] = $k;}print_r($temp);
版主的思路漂亮,这里提供另一种思路。
输出?>