0

I have json code but I can't get some values from this. How can I get active cases from this json with php?

{
  "get": "statistics",
  "parameters": {
    "country": "Azerbaijan"
  },
  "errors": [],
  "results": 1,
  "response": [
    {
      "continent": "Asia",
      "country": "Azerbaijan",
      "population": 10234800,
      "cases": {
        "new": "+148",
        "active": 2242,
        "critical": null,
        "recovered": 331350,
        "1M_pop": "33082",
        "total": 338586
      },
      "deaths": {
        "new": "+2",
        "1M_pop": "488",
        "total": 4994
      },
      "tests": {
        "1M_pop": "383089",
        "total": 3920841
      },
      "day": "2021-07-20",
      "time": "2021-07-20T17:00:03+00:00"
    }
  ]
}

How do I decode this in PHP and access the resulting data?

0 Answers0