title: String change and enumerate values PHP
body: <p>i have a string, and I want to change the values to be in rearranged, for example i have this:</p>
  
  <pre><code>{
  "code_2":"CODGD",
  "description_2":"First product",
  "price_2":"45.0",
  "quantity_2":"1",
  "quantityant_2":"1",
  "subtotal_2":"45.0",
  "code_3":"CODRT",
  "description_3":"Second product",
  "price_3":"12.68",
  "quantity_3":"1",
  "quantityant_3":"1",
  "subtotal_3":"12.68",
  "code_7":"CODPO",
  "description_7":"Third product",
  "price_7":"434.0",
  "quantity_7":"1",
  "quantityant_7":"1",
  "subtotal_7":"434.0"
  }
  </code></pre>
  
  <p>It goes like 2,3 and 7 but i need them to be 1,2,3
  Every object are in group of 6; code_1, description_1, price_1, quantity_1, quantityant_1, subtotal_1. 
  What I need is that the objects surronded by _ and " be renumerated, for example like this:</p>
  
  <pre><code>{
  "code_1":"CODGD",
  "description_1":"First product",
  "price_1":"45.0",
  "quantity_1":"1",
  "quantityant_1":"1",
  "subtotal_1":"45.0",
  "code_2":"CODRT",
  "description_2":"Second product",
  "price_2":"12.68",
  "quantity_2":"1",
  "quantityant_2":"1",
  "subtotal_2":"12.68",
  "code_3":"CODPO",
  "description_3":"Third product",
  "price_3":"434.0",
  "quantity_3":"1",
  "quantityant_3":"1",
  "subtotal_3":"434.0"
  }
  </code></pre>
  
  <p>I been thinking in using str_replace but im a little lost.</p>
  
  <p>Hope you can help me.</p>
  
  <p>Thanks</p>
  
  <p>Extra details
  I actually get the info in an array with this form:</p>
  
  <pre><code> Array([code_2] =&gt; CODGD[description_2] =&gt; First product[price_2] =&gt; 45.0[quantity_2] =&gt; 1[quantityant_2] =&gt; 1[subtotal_2] =&gt; 45.0[code_3] =&gt; CODRT[description_3] =&gt; Second product[price_3] =&gt; 45.0[quantity_3] =&gt; 1[quantityant_3] =&gt; 1[subtotal_3] =&gt; 45.0[code_7] =&gt; CODPO[description_7] =&gt; Third product[price_7] =&gt; 23.43[quantity_7] =&gt; 1[quantityant_7] =&gt; 1[subtotal_7] =&gt; 23.43)
  </code></pre>