重新安排php数组

wym*_*man 4 php arrays

我有一个阵列

Array ( [1] => Vice President [3] => Secretary [5] => Treasurer ) 
Run Code Online (Sandbox Code Playgroud)

我想改变它

Array ( [0] => Vice President [1] => Secretary [2] => Treasurer ) 
Run Code Online (Sandbox Code Playgroud)

我试过我们的php for loop函数

$ub_new_arr_sort = array();
for($i3 = 0; $i3 < count($ub_new_arr); $i3++){
$ub_new_arr_sort[] = $ub_new_arr[$i3];
}
Run Code Online (Sandbox Code Playgroud)

但似乎根本不工作,任何想法?

谢谢你提前.

Fra*_*nes 12

只是用array_values.

$array = array_values($array);
Run Code Online (Sandbox Code Playgroud)