array_diff & renumbering numeric keys
arrays, key, numeric, php
Solution
To reset the keys, you can use `array_values()`:
$array = array_values($array);
Problem
``` (I'm a beginner) ``` My script uses the standard ``` $c = 0; $t = count($array); while ($c < $t) { $blah = $array[$c]; ++$c; } ``` rather extensively. But I just ran into a situation where I also need `array_diff` and it breaks that all to hell because now the numeric keys have gaps. I'm getting `Undefined offset` errors all over the place. How do I reset the numeric keys of an array? The order of the objects in the array is irrelevant.