Reset PHP Array Index

The array_values() function [docs] does that:

$a = array(
    3 => "Hello",
    7 => "Moo",
    45 => "America"
);
$b = array_values($a);
print_r($b);
Array
(
    [0] => Hello
    [1] => Moo
    [2] => America

Leave a Comment

tech