I am getting xmlrpc xml posted to my server and I want to catch the xml and store it in a text file for later processing.
This is what I have, but I just get a blank text file
$getXML = file_get_contents('php://input');
$xml = new SimpleXMLElement($getXML);
$text = $xml->Text;
$today = date("Y-m-d");
$randomnr = rand(100000, 999999);
$datet = date("Ymd-H:i:s");
$filename = "/var/www/".$datet."-".$randomnr.".txt";
$fh = fopen($filename, 'w') or die("can't open file");
fwrite($fh, $text);
fclose($fh);
Can anyone see why I cam getting a blank text file?