I have a little problem, I want to sort my table :
I want this
array([1] => "value 1", [3] => "value 2", [5] => "value 3");
to become this
array([0] => "value 1", [1] => "value 2", [2] => "value 3");
I have a little problem, I want to sort my table :
I want this
array([1] => "value 1", [3] => "value 2", [5] => "value 3");
to become this
array([0] => "value 1", [1] => "value 2", [2] => "value 3");
I misread the question: corrected, try this way or use array_map or array_values;
foreach($a as $item){
$newarray[] = $item;
}
print_r($newarray);