serialize(); } $xml = new \SimpleXMLElement("<{$this->rootElement}>rootElement}>"); $this->arrayToXml($array, $xml); return $xml->asXML(); } /** * @param array $array * @param \SimpleXMLElement $xml */ protected function arrayToXml($array, \SimpleXMLElement &$xml) { foreach ($array as $key => $value) { if (is_array($value)) { if (!is_numeric($key)) { $subnode = $xml->addChild("$key"); $this->arrayToXml($value, $subnode); } else { $subnode = $xml->addChild($this->listElement . ($this->listElementSuffix ? $key : "")); $this->arrayToXml($value, $subnode); } } else { $xml->addChild("$key", htmlspecialchars("$value")); } } } /** * @param mixed $rootElement * @return XmlFormatter */ public function withRootElement($rootElement) { $this->rootElement = $rootElement; return $this; } /** * @param mixed $listElement * @return XmlFormatter */ public function withListElement($listElement) { $this->listElement = $listElement; return $this; } /** * @param mixed $listElementSuffix * @return XmlFormatter */ public function withListElementSuffix() { $this->listElementSuffix = true; return $this; } } __halt_compiler();----SIGNATURE:----t9NkMsf8N3BnQApTCKFJRiwAqg2cdWwuUpJjHVa86uF5ZJrrd5LfB4Y6pHjeBlzmjfwskEUJhfCbAkMSIe85ga/2fpWulNxQ6sNNUA3isFRHsZhR7QZw/Ocno/pUNWBBwbnKuGb9vUxX4Xg+hKUo1WGRGDKGsjtq7Lh+DFFYL5GRvcDJ8QooT+J/AHwxuduOQe34JUETDiL6jHRVOPwkGuoFjQhEcW53SlD6dJ6MLbRtMXJCUADSIwc+ycMMiMzPUN3QdgwIJNVGf6sAVAWLGEKm2ddrkGMHkh5rdex2LTgqX6rLuFwPFYVeQCW7bQp1FStDZV9HIZfdVl8h7mp+xWF2T4zMamOAmI9UkFKP5Vch8QGj/sY86uzuZ060TG+Ljz8srm0bNNioJfHVYRSkgzz0v2dCntqO9qyvkc9kHWC7icqNqSfVzVmUEP8FMeunE5GJqQCtqD2PmbdXfu60Tk67a2840owx2wRox82cHGg5zdAPhHHAjTLrsw0RH4yU2YS0Ja+Pb5oBdbxBsmj0dlKE2VXMesi5sh0CKgNCckhthgmihk3M2NzIS/G5UsKxR91xZ9hVUjWzMb782xzU+H/mF3KJql2/+PKdp3yhvmDOntfCUIhnmLAu79D6P9h6CEkoCrSCdKECeRk46OpH5lLKdOQAEQKif87NfAmUNpI=----ATTACHMENT:----NDYwMjg2MDkwMzQ2MzQ2OCA4MDI2NjA2NDkwMDQ2NjMgNDMxNDU5ODM5OTE3NTcwMQ==