title: PHP/JSON - Remove every occurence of certain character before another character
body: <p>My JSON is encoding peculiarly, so I need to remove every quote before a right-opening bracket. (e.g. every " before a {)  Is it possible to do this in PHP, and if so, how?</p>
  
  <p>"{ I would want to remove every occurrence of the quote before the bracket.</p>
  
  <p>JSON here: <a href="http://devticker.pw/json-data.php" rel="nofollow">http://devticker.pw/json-data.php</a></p>
  
  <p>Code here:</p>
  
  <pre><code>while($row = mysqli_fetch_array($result))
  {
  $data[] = '{"c": [{ "v": ' . $row['Timestamp'] . '"},{"v":' . $row['USD'] . '} ]}';
  }
  
  $str = json_encode(array("rows"=&gt;$data));
  
  $str = substr($str, 1);
  
  $str = str_replace("\"{", "{", $str);
  
  $str = '{"cols":[{"type":"string"},{"type":"number"}],' . $str;
  
  $str = stripslashes($str);
  
  echo $str;
  </code></pre>