Is it possible to edit the key once it has been made?
I know you can create an array with a different key but I couldn’t see anything on the php site about editing the key latter.
Original array:
Array
(
[0] => first
[1] => color
)
What I would like:
Array
(
[newName] => first
[1] => color
)
If you want to change the key of an item, you must either set the value with the new key and
unset()the old one (this technique changes the order of the array):or use a wrapper that forgoes looping and allows you to modify the keys, as such: