1

im using an external mongodb to get json results. I have like 1.000.000 arrays that contain this (this is 1 of those million arrays):

{
  "name" : "A Bubble",
  "summonerId" : NumberLong(41119375),
  "region" : "euw",
  "level" : NumberLong(30)
}

how do I remove the Numberlong() from the code? needs to happen for x amount of arrays. Im working with php files.

this is what i want:

{
  "name" : "A Bubble",
  "summonerId" : 41119375,
  "region" : "euw",
  "level" : 30
}
floppy
  • 333
  • 2
  • 14
  • What are you receiving this object in, PHP, Javascript? Also, do you have php access to it as an array. And if so is the 'NumberLong(34323423)' portion a variable type string? – Evadecaptcha Oct 08 '14 at 00:00
  • this is a file on my server, like \index.php and \jsonfile.txt. i have full php access to the json file. i dont understand your 2nd question. – floppy Oct 08 '14 at 00:03
  • 1
    It's json encoded right? Try to $array = json_decode($jsonObject) to see if you get a legible array. – Evadecaptcha Oct 08 '14 at 00:07
  • Have you read this: http://stackoverflow.com/a/23000746/1503018 ? – sectus Oct 08 '14 at 00:25
  • Take a look at my question and [answer](http://stackoverflow.com/a/23040988/1090562) about NumberLong and PHP – Salvador Dali Oct 08 '14 at 04:22
  • yes thank you, i got it solved already :) – floppy Oct 08 '14 at 10:22

0 Answers0