Hello! I will explain with an example what needs to be done. There is an array

Array ( [0] => val [3] => val2 [4] => val3 [10] => val4 ) 

Without changing the order of the elements, simply change the keys to 0, 1, 2 etc:

 Array ( [0] => val [1] => val2 [2] => val3 [3] => val4 ) 

Is there a standard feature in php for this?

    1 answer 1

    there is a function array_values

     $array = array("size" => "XL", "color" => "gold"); print_r(array_values($array)); 

    result

     Array ( [0] => XL [1] => gold ) 

    PHP manual