Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php update json file

$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";
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #update #json #file
ADD COMMENT
Topic
Name
7+5 =