Answers for "file_put_contents same file name"

PHP
2

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);
Posted by: Guest on November-10-2019

Code answers related to "file_put_contents same file name"

Browse Popular Code Answers by Language