Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

json data wdit in php

$data[0]['activity_name'] = "TENNIS";
// or if you want to change all entries with activity_code "1"
foreach ($data as $key => $entry) {
    if ($entry['activity_code'] == '1') {
        $data[$key]['activity_name'] = "TENNIS";
    }
}

$newJsonString = json_encode($data);
file_put_contents('jsonFile.json', $newJsonString);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #json #data #wdit #php
ADD COMMENT
Topic
Name
9+5 =