file_put_contents php json file
$data[] = $_POST['data']; $inp = file_get_contents('results.json'); $tempArray = json_decode($inp); array_push($tempArray, $data); $jsonData = json_encode($tempArray); file_put_contents('results.json', $jsonData);
append data to json file php
test1rwww33rwrw
php json array push in js file
{"Markers": [ { "title" : "Meow Monestary", "position" : { "lat" : 40.5178, "lng" : -122.6438 }, "posterContact" : { "name" : "Mr Meowser", "email" : "MrMeow@Couch.com", "phone" : "(555)-202-3040", "private" : true }, "type" : "myResidence", "ownerContact" : { "name" : false, "email" : false, "phone" : false, "private" : true }, "description" : "Meow meow purrrrr. Dogs are not my favorite but they are my second favorite.", "private" : true },
Source: stackoverflow.com