protected function sendRequest($method, $data = null) { $result = parent::sendRequest($method, $data); $response_body = $result['response_body']; $data = json_decode($response_body, true); if (isset($data['dns_zone'])) { $records = $data['dns_zone']['records']; $dns_records = array(); foreach (array('MX', 'SRV', 'A', 'CNAME', 'AAAA', 'TXT', 'NS', 'SOA') as $type) { if (array_key_exists($type, $records)) { $dns_records = array_merge($dns_records, $records[$type]); } } $result['response_body'] = json_encode($dns_records); } return $result; }