$filename,'role'=>$rolle, 'task'=> $task, 'form'=>$_POST['form']); $inp = file_get_contents('../callbacks/DTC_EVENT.txt'); $tempArray = json_decode($inp); array_push($tempArray, $rolleArray); $data = json_encode($tempArray); $date = date('d/m/Y h:i:s a', time()); error_log("save data to file", 3, 'logs.log'); error_log($date, 3, 'logs.log'); error_log("\r\n", 3, 'logs.log'); file_put_contents('../callbacks/DTC_EVENT.txt', $data); $general = []; $general[] = $_SERVER; $general[] = $_POST; $general[1]["form"] = $formLocation.$form; $jsonData = json_encode($general, JSON_PRETTY_PRINT); file_put_contents('../callbacks/'.$filename.'.txt', $jsonData); header('CPEE_CALLBACK: true'); exit; ?>