<?php 
$startdate = date('Y/m/d H:i:s');
ini_set('display_errors', 'On');
error_reporting(E_ALL);

$json = file_get_contents('php://input'); 
$obj = json_decode($json);
$fp = fopen("/tmp/mmsdlr.txt", "ab");
fwrite($fp, "\n\n".$startdate."\n");
fwrite($fp, "OBJ   :[".print_r($obj, true))."]\n";
fwrite($fp, "JSON  :[".print_r($json, true))."]\n";
fwrite($fp, "OBJORG:[".$json."]\n");
fclose($fp);

echo "Received.";

#$data = json_decode(file_get_contents('php://input'), true);
#$grabar='ESTO ES LO NUEVO: ['.print_r($data, true).']';

#        $fp = fopen('/tmp/mmsdlr.txt', 'a');
#        fwrite($fp, $data);
#        fwrite($fp, print_r($_POST, true));
#        fwrite($fp, print_r($grabar, true));            
#        fclose($fp);
#        print_r($_POST); 
?>





