Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
 
PREVIOUS NEXT
Tagged: #php #json #file
ADD COMMENT
Topic
Name
3+4 =