title: json_encode adding unwanted slashes
body: <p>I have a json string saved in my db. When i retrieve it from db to pass it to the javascript function (ajax call) , along with the id of that row, i am json_encoding both (the query result array) and passing it to js. but json_encode is adding unwanted slashes to my already json string. how to escape it. remember i have to pass the id also as second element in array.</p>
  
  <p>my json string in db is like:</p>
  
  <pre><code>{"field":"City","term":"Hawaiian Gardens, CA"}
  </code></pre>
  
  <p>and the id is say 5.</p>
  
  <p>so the query result array in PHP is:</p>
  
  <pre><code>$savedVal['id'] = 5 
  $savedVal['object_str'] = {"field":"City","term":"Hawaiian Gardens, CA"}
  </code></pre>
  
  <p>so after json_encode($savedVal) ideally it should be:</p>
  
  <pre><code>{"id":"5","object_str":{"field":"City","term":"Hawaiian Gardens, CA"}}
  </code></pre>
  
  <p>but json_encoding the array gives me:</p>
  
  <pre><code>{"id":"5","object_str":"{\"field\":\"City\",\"term\":\"Hawaiian Gardens, CA\"}}
  </code></pre>
  
  <p>extra slashes and quotes too around object_str value. 
  Please help me.</p>
  
  <p>Thank you.</p>