You are on page 1of 1

<?

php

$file5 = fopen("file6.txt", "r") or die("Unable to open file!");


$size4 = filesize("file6.txt");
$text4 = fread($file5,$size4);
fclose($file5);

$timestamp = date("d-m-Y - H:i:s");


$content = trim(file_get_contents("php://input"));
$data = json_decode($content, true);

$file = fopen("file6.txt", "w") or die("Unable to open file!");


fwrite($file, $text4."\n".$timestamp."---".$data["Distancia_1"]."-".
$data["Distancia_2"]."-".$data["Distancia_3"]."-".$data["Bateria_AA"]."-".
$data["Bateria_18"]."-".$data["Usuario"]."-".$data["T1"]."-".$data["T2"]."-".
$content);
fclose($file);

$myObj1 = new \stdClass();


$myObj1->noti = 0;
$myObj1->muUl = 30;
$myObj1->muBa = 30;
$myObj1->minu = 1;
$myObj1->hora = 0;

$myJSON = json_encode($myObj1);

echo $myJSON;

?>

You might also like