>The only way I can think of is to loop through the array, copying array
>values to new keys, and unsetting the old key.
Yeah, that's pretty much it:
foreach(array_keys($array) as $old_key) {
$array[new_key($old_key)] = $array[$old_key];
unset($array[$old_k
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 m
2 matches
Mail list logo