Access to a element in a array


#1

Hi!

I have a json that looks like this

{
    "aplication": "aula3vga",
    "nclients": "6",
    "anchoBanda[Mbs]": 9.315848,
    "dataclients": [
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "WIN 20,0,0,272",
            "timeonline": 91.745916666667
        },
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "WIN 20,0,0,286",
            "timeonline": 93.219316666667
        },
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "WIN 20,0,0,286",
            "timeonline": 192.93105
        },
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "WIN 20,0,0,286",
            "timeonline": 313.38386666667
        },
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "LNX.11,1,102,55",
            "timeonline": 1271.8307333333
        },
        {
            "aplication": "aula3vga",
            "ipclient": "********",
            "flashver": "WIN 18,0,0,209",
            "timeonline": 3186.85215
        }
    ]
},

I want to access to all ipclient elements and use the filter geoip with theses ip´s being the result somethig like this

 {
        "aplication": "aula3vga",
        "nclients": "6",
        "anchoBanda[Mbs]": 9.315848,
        "dataclients": [
            {
                "aplication": "aula3vga",
                "ipclient": "********",
                "flashver": "WIN 20,0,0,272",
                "timeonline": 91.745916666667
                "geoip": {
                "ip": "79.146.194.67",
                "country_code2": "ES",
                "country_code3": "ESP",
                "country_name": "Spain",
                "continent_code": "EU",
                "region_name": "29",
                "city_name": "Pinto",
                "postal_code": "28320",
                "latitude": 40.2415,
                "longitude": -3.6999999999999886,
                "timezone": "Europe/Madrid",
                "real_region_name": "Madrid",
                "location": [
                   -3.6999999999999886,
                  40.2415
                 ],
                "coordinates": [
                  -3.6999999999999886,
                  40.2415
                 ]
                 }
             },

Thanks in advance.


(system) #2