Chcę zrobić panel i tabelę z punktami drużyn, przez plik json, wszystko już mam oprócz edycji jsona przez panel. Iteraz mam pytanie;


Co tu jest źle, jak dam po linijce z file_put_contests np.
  1. echo "<h1>1</h1>"
to wyświetla ale nie edytuje jsona
Jak do tabeli chcę dać wratość tego jsona to działa
I podaje, ale nie edytuje a nie mogę znaleźć czemu



  1.  
  2. <input type="radio" id="select-4" name="give-points4" value="select-4">
  3. <label name="quantity" for="quantity">Ilość punktów:</label>
  4. <input type="number" id="quantity" name="quantity" min="1" max="999"> <br> <br>
  5.  


Plik json
  1.  
  2. {
  3. "teams": [{
  4. "pts4": "0",
  5. }]
  6. }
  7.  



  1.  
  2. $current_data = file_get_contents("points.json");
  3. $array_data = json_decode($current_data, true);
  4. $array_data['teams']['0']['pts4'] = "$quantity";
  5. $newJsonString = json_encode($array_data);
  6. file_put_contents('points.json', $newJsonString);
  7.