title: php array to json with index keys(without json droping the keys)
body: <p>hi I'm trying to return a JSON response with PHP and i need my array to have numeric keys but when i use <code>array_values</code> JSON drops the key and it only returns the value</p>
  
  <pre><code>$diffFinal = array_values($diffArray);
  </code></pre>
  
  <p>but my json is : </p>
  
  <pre><code>"diff": [
    "2 days ago",
    "35 days ago",
    "67 days ago",
    "98 days ago",
    "129 days ago",
    "189 days ago",
    "220 days ago",
    "255 days ago",
    "288 days ago",
    "322 days ago",
    "351 days ago",
    "415 days ago",
    "463 days ago",
    "509 days ago",
    "510 days ago"
  ]
  </code></pre>
  
  <p>and i want to be like </p>
  
  <pre><code>    "diff": [
    "1" : "2 days ago",
  </code></pre>
  
  <p>I've read some things about JSON, that it does this, but is there any way that i can do it?
  Thank you, all help are appreciated</p>