Sunday 17 December 2017

javascript - Foreach JSON with random keys

I currently experience the problem when i want to
deserialize json. I dont know how to do this with unknown
keys



[


{
"84.200.222.4": [
0.022
]
},

{
"84.200.230.82": [
1.315
]

},

{
"80.156.160.161": [
0.874

]
},
{
"72.14.217.108": [
0.662

]
},

{
"108.170.251.193": [

0.638
]
},
{
"216.239.54.61": [

0.64
]
},

{
"172.217.23.131":
[
0.564
]

}
]


How
would i go about this when i
want




1.
84.200.222.4
- 0.022

2. 84.200.230.82
-
1,315

3. 80.156.160.161
- 0.874

4
72.14.217.108

-
0.662


Etc.. I'm
currently not sure on how to loop through unknown keys is that
possible?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...