You are here: Re: Replacing key in associative array « PHP Language « IT news, forums, messages
Re: Replacing key in associative array

Posted by Geoff Berrow on 01/30/07 08:31

Message-ID: <6Kxvh.3172$9S5.2639@text.news.blueyonder.co.uk> from David
Smithz contained the following:

>if there is a key with value "key2", change this key name so it is instead
>"key number 2" (while maintaining the keys value).
>
>This is harder to achieve then I thought unless I'm getting myself in a
>muddle?

$array['key number 2']=$array['key2'];
//optionally
unset($array['key2']);

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация