I have a array
Array ( [1] => Vice President [3] => Secretary [5] => Treasurer )
I want make it change to
Array ( [0] => Vice President [1] => Secretary [2] => Treasurer )
I have try us php for loop function
$ub_new_arr_sort = array();
for($i3 = 0; $i3 < count($ub_new_arr); $i3++){
$ub_new_arr_sort[] = $ub_new_arr[$i3];
}
but seem like not work at all, any idea?
Thanks for advance.
Use foreach instead of for to be 'key independant':
foreach($oldarray as $position){
$newArray[] = $position;
}
print_r($newArray);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With