this is the JSON below I want to parse
{"events": [{"eventId": 2, "payload": {"chat": {"chatId": "683473108@chat.agent", "title": "TrojanTest", "type": "group"}, "from": {"firstName": "Khan", "nick": "Mr.Tr0J4n", "userId": "751401693"}, "msgId": "6895591502924218369", "text": "524545", "timestamp": 1605505008}, "type": "newMessage"}], "ok": true}
I want to parse msgId
and chatId
from this JSON.
How can I do that in PHP?