title: How to update/edit a JSON file using PHP
body: <p>Here is my <strong>JSON</strong></p>
  
  <pre><code>[
     {
        "activity_code":"1",
        "activity_name":"FOOTBALL"
     },
     {
        "activity_code":"2",
        "activity_name":"CRICKET"
     }
  ]
  </code></pre>
  
  <p>I need to update <code>{"activity_code":"1","activity_name":"FOOTBALL"}</code> to <code>{"activity_code":"1","activity_name":"TENNIS"}</code> based on <code>activity_code</code></p>
  
  <p>How can I achieve this in PHP?</p>