csnyder wrote:
What you can do is first identify the key/value pair you want to change.
Then read out the value, then use unset($array['key']), then add the
saved value to the array with the desired key name.

The trick is that your new key=>value pair will be at the end of the
array, not the third element.

I need to rename a single key "in-place" in a very large array.

Then use Ben's proposal...way cleverer than mine and it gets you what you want. I really don't understand why position within the array matters. That is why the values have a key, isn't it?

David
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to