Dump XML Posts from 'php://input' to file
        Posted  
        
            by Mikey1980
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Mikey1980
        
        
        
        Published on 2010-06-08T03:28:41Z
        Indexed on 
            2010/06/08
            3:32 UTC
        
        
        Read the original article
        Hit count: 404
        
I'm trying to write a parser for a xml postback listener, but can't seem to get it to dump the xml for a sample. The API support guy told me to use 'DOMDocument', maybe 'SimpleXML'? Anyways here's the code: (thanks!)
<?php
$xml_document = file_get_contents('php://input');
$doc = new DOMDocument();
$doc->loadXML($xml_document);
$doc->save("test2/".time().".sample.xml").".xml");
?>
© Stack Overflow or respective owner