title: change json key name [ json generated using json_encode ]
body: <p>I am generating json from an array using <code>json_encode()</code>, it's working properly, but it uses the key:value from the array, as usual. but I want to change the name of the key only in the json output.. is it possible to do it ? or should I prepare the json key:values myself manually ?</p>
  
  <p>Example:</p>
  
  <pre><code>$arr = array ('a'=&gt;1,'b'=&gt;2,'c'=&gt;3,'d'=&gt;4,'e'=&gt;5);
  
  echo json_encode($arr);
  </code></pre>
  
  <p>O/P</p>
  
  <pre><code>{"a":1,"b":2,"c":3,"d":4,"e":5}
  </code></pre>
  
  <p>I want .</p>
  
  <pre><code>{"foo":1,"something":2,"bar":3,"foo":4,"baz":5}
  </code></pre>
  
  <p>edit : I cannot edit the original array..( generated using framweork)</p>