I would like in php to stop duplicate messages by logging msgid to a text file using something like this `file_put_contents("a.txt", implode(PHP_EOL, $array1), FILE_APPEND);`
and then converting it back to an array using `$array1 = file("a.txt");` I would also like to delete messages from the array if they are from a set name
I know how to convert json to an array `$array1 = json_decode($json, true);`
**Json Reply from an api that I cannot control**

```
{
  "API": "Online",
  "MSG": [
    {
      "info": {
        "name": "example"
      },
      "msg": "example",
      "msgid": "example"
    },
    {
      "info": {
        "name": "example"
      },
      "msg": "example",
      "msgid": "example"
    }
  ]
}

```