I am building a simple api to Post/Return XML for my app. Here is the code:
$returnData = array (
"ResultCode" => "0",
"ResultString" => "uppdated"
);
$xml = new DOMDocument();
$dateInfoElement = $xml->createElement("versionCheckResult");
foreach ($returnData as $key => $value) {
$xmlNode = $xml->createElement($key,$value);
$dateInfoElement->appendChild($xmlNode);
}
$xml->appendChild($dateInfoElement);
echo $xml;
Sadly, I am getting no return, not a thing. Php is not my strong side but it seemed easier than working with Node.JS and mongoDB. Can you tell me what I am doing wrong?