NYCPHP Meetup

NYPHP.org

[nycphp-talk] Rename an array key?

csnyder chsnyder at gmail.com
Tue Jul 24 11:45:30 EDT 2007


Anyone know of an easy way to rename an associative array key in place?

array( 'vegetable'=>'lettuce', 'fruit'=>'coconut', 'bean'=>'chickpea',
'grain'=>'corn' )

I want the third element to be 'legume'=>'chickpea', but it seems to
involve rebuilding the array...?

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list