0

This is my json_encoded result {"id":"1","users":"12325546sw","total":"27","Apps":[{"Row":"37","AppIcon":null,"Apps":"Group Play","DataConsumed":"3","Updated":"2017-12-12 07:16:22"},{"Row":"34","AppIcon":null,"Apps":"Gallery","DataConsumed":"24","Updated":"2017-12-12 07:16:22"}]}

Just i want to remove quotes of the value of id..

ImSarah
  • 13
  • 5
  • 2
    https://stackoverflow.com/questions/13938645/remove-double-quote-in-json-encode – Casper Dec 15 '17 at 06:26
  • @casperSL the link you shared it removed the qoutes of all keys in the json result, i just want to remove the qoute of a value regarding id key not all.. just a specific key value – ImSarah Dec 15 '17 at 06:29
  • You can first convert your json string to php array and then update id in foreach and then convert back array to json string. – Amit Gupta Dec 15 '17 at 06:47

1 Answers1

2

try this

in the json encode pass the second paramater as JSON_NUMERIC_CHECK

json_encode($data, JSON_NUMERIC_CHECK);
Arun Kumaresh
  • 6,211
  • 6
  • 32
  • 50