change json key name [ json generated using json_encode ]
Only if you rewrite 'm yourself. You could use:
$rewriteKeys = array('a' => 'foo', 'b' => 'something', 'c' => 'bar', 'd' => 'foo', 'e' => 'baz');
$newArr = array();
foreach($arr as $key => $value) {
$newArr[ $rewriteKeys[ $key ] ] = $value;
}
echo json_encode($newArr);
Not sure if that's what you were aiming for.