Consider the following script. Which PHP function best approximates its behavior? Select one: a. file_get_contents() b. file_put_contents() c. There is no equivalent function in PHP d. file() e. fputs() code example
Example: 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);