Theoretical question that perhaps does not make any sense but still, maybe there is a clever answer.
I want to iterate through array and get its keys and to somethin
If you want to set all keys to certain value you can just do it this way:
$array = array(
'foo'=> 'oldval1',
'bar'=> 'oldval2',
'baz'=> 'oldval3'
);
$other_array = array_fill_keys(array_keys($array), 'something');
print_r($other_array);
This will produce:
Array
(
[foo] => something
[bar] => something
[baz] => something
)