array( 'method' => 'PUT', 'header' => 'Content-type: application/json', 'content' => json_encode(array( "result"=>$_GET)) ) ); $filename ='../callbacks/'. $_GET['id'].'.txt'; $fContent = file_get_contents($filename); $fin = json_decode($fContent,true); $link = $fin[0]['HTTP_CPEE_CALLBACK'].'/'; $context = stream_context_create($opts); $result = file_get_contents($link, false, $context); error_log("send PUT", 3, 'logs.log'); error_log($date, 3, 'logs.log'); error_log("\r\n", 3, 'logs.log'); print_r($result); # delete file unlink($filename); # delete item in DTC list (in db bool marker 0 or 1) $data = file_get_contents('../callbacks/DTC_EVENT.txt'); $dtc = json_decode($data, true); foreach ($dtc as $key => $value) { if (in_array($_GET['id'], $value)) { unset($dtc[$key]); } } $dtc = json_encode(array_values($dtc), JSON_PRETTY_PRINT); file_put_contents('../callbacks/DTC_EVENT.txt', $dtc); header("Location: http://192.168.20.133:8080/PHP/forms/start.html"); exit; ?>