Add missing keys into array
your questions is very vague and hard to understand exactly what you want, from my interpretation it seems you want to insert a key into the array moving the current keys along the index line.
you may want to try something like this:
function cleanArray(&$array){ end($array); $max = key($array); //Get the final key as max! for($i = 0; $i < $max; $i++) { if(!isset($array[$i])) { $array[$i] = ''; } }}cleanArray($array);