In PHP, how do you change the key of an array element?

$arr[$newkey] = $arr[$oldkey];
unset($arr[$oldkey]);

Leave a Comment