Save XML retrieved with rest and php

Mogale

New Member
I can retrieve certain information with a rest command, the data it shows (in the browser) is already an XML. How do I save it to an XML file on the server after retrieving the information.I have already tried it with the $dom-save command but I seem to do something wrong. Any help would be appreciated. See below for code (I want to save the $response to XML.)\[code\]<?phprequire_once 'includes/rest_connector.php';require_once 'includes/session.php';// check to see if we start a new session or maintain the current onechecksession();$rest = new RESTConnector();$url = "/api/tax_codes/0/";$rest->createRequest($url,"GET", null, $_SESSION['cookies'][0]);$rest->sendRequest();$response = $rest->getResponse();$error = $rest->getException();// save our session cookiesif ($_SESSION['cookies']==null) $_SESSION['cookies'] = $rest->getCookies();// display any error messageif ($error!=null)echo $error;// display the responseif ($response!=null)echo $response;elseecho "There was no response."; ?>\[/code\]
 
Back
Top