- var_dump: documentation ( source)
<?php
$arr = array(
'Test' => 1,
'OtherKey' => 2
);
$keyTranslation = array(
'Test' => 'Test',
'OtherKey' => 'OtherKey'
);
function test(&$arr, $keyTranslation) {
foreach ($arr as $key => $value) {
$arr[$keyTranslation[$key]] = $value;
unset($arr[$key]);
}
}
var_dump(test($arr, $keyTranslation));