I have an associative array in the form key => value where key is a numerical value, however it is not a sequential numerical value. The key is actually an I
key => value
The answer from KernelM is nice, but in order to avoid the issue raised by Greg in the comment (conflicting keys), using a new array would be safer
$newarr[$newkey] = $oldarr[$oldkey]; $oldarr=$newarr; unset($newarr);