Hello. There is a JSON of this type:

{ "response":{ "count":10, "items":[], "profiles":[], "groups":[] } } 

How to get from it the number of elements that are contained in groups?

    1 answer 1

    For example, you can like this:

     $json = '{"response": {"count": 10, "items": [], "profiles": [], "groups": [] } }'; $arr = json_decode($json, true); echo count($arr['response']['groups']);