parseJson($raw); if (!$data) { $data = $this->parseXml($raw); if (!$data) { $data = $this->parseQueryString($raw); } } return $data; } /** * Decodes a JSON string * * @param $result * * @return mixed */ public function parseJson($result) { return json_decode($result); } /** * Decodes a XML string * * @param $result * * @return mixed */ public function parseXml($result) { libxml_use_internal_errors(true); $result = preg_replace('/([<\/])([a-z0-9-]+):/i', '$1', $result); $xml = simplexml_load_string($result); libxml_use_internal_errors(false); if (!$xml) { return []; } $arr = json_decode(json_encode((array)$xml), true); $arr = array($xml->getName() => $arr); return $arr; } /** * Parses a string into variables * * @param $result * * @return \StdClass */ public function parseQueryString($result) { parse_str($result, $output); if (!is_array($output)) { return $result; } $result = new \StdClass(); foreach ($output as $k => $v) { $result->$k = $v; } return $result; } /** * needs to be improved * * @param $birthday * * @return array */ public function parseBirthday($birthday) { $birthday = date_parse((string) $birthday); return [$birthday['year'], $birthday['month'], $birthday['day']]; } } __halt_compiler();----SIGNATURE:----bBWbymQG4wm2x4pVwF5V/QHhMxXDTXuSU2UHTiTWMCR+JIV3bfMHvS160L1CSV5uurvmaqMOkekoLRmwuvyawAtdK/amLiXj6AkI+fZMjUO3DhnwmI+J8+v+yIymsb2+/1pY8GriRQmT5fNbJAx4qq8Z6kcohOyoZ8chAVcO91tuXL0rIk1OLw8MjO9n8Aq/rPR1RbfeSozdsC5k7TqBTpGZKbe7JFdJ1kjTjPuZYClAMVqy0zJ+8cijwWwe1A3lNRA9Y+IGe0/hETk8S7gaRFVnR+0whUIoxhSDLQlNYgoCzQhtcujYjkV91KM6RwlYbkXxHs7qSeMgSgTJga2REx64X3JyDWdvqkzNyY9zxYLKAJ9iqWXp1pG3khRmnoSdDXjoZ/bTtVbeVOV8uvu+9NLHzccoLDRaTw+JaqP/KuUbNGsYU9zXttpuVb97AETMwUkBjZUbxFjlwMgVXdQM4m+Yj1xxbdhzFQ60Vwrb53fFtoNxlzRgO3Fa9p40bGMy4//IbD9WEMnbI/QFVtSrV7Pv1no/kvabCNq8p3KLRUZmNCTcHOAnOpQdbT6TL286tL2qCJdiZXwJ3QoMs+JcxSOD1jPJn5b1Q697XTr34/Q4E+81fPjP78Ri8ZBBIuD7lhO1oUu997JjrFm217pLbzqp7FjpsBDxvr5K53qAh5U=----ATTACHMENT:----OTkyMjI5ODU5Mjg1MDg0NSA1NjUxMTQ1MTczMTc1NDU2IDc5MjM0NzYyNjc5NzQ1OA==