You might be able to create some function that uses a combination of array_keys(), array_values(), and array_combine() to do what you want. Check the manual at http://www.php.net/array for more information on these functions.


Gerard Samuel wrote:
Im looking for the fastest way to modify array keys.
For example, changing ->
$foo['hello_world'] = 'HELLO WORLD';
to
$foo['hello'] = 'HELLO WORLD';

The only way I can think of is to loop through the array, copying array values to new keys, and unsetting the old key.

Thanks for any insight you may provide...

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to