php array chnage array default key with inside key code example Example: change key with the value php $arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);