public function convert_to_array($raw_data)
	{
		$xml = new \SimpleXMLElement($raw_data);
		$xml->registerXPathNamespace(
			self::XML_NAMESPACE,
			self::XML_NAMESPACE_URL
		);

		$data = $xml->xpath(self::XPATH_CURRENCY);
		$currencies = array();

		foreach ($data as $currency)
		{
			$currencies[ (string) $currency->attributes()->currency] = (string) $currency->attributes()->rate;
		}

		return $currencies;
	}
public function convert_to_array($raw_data)
	{
		$xml = new \SimpleXMLElement($raw_data);
		$xml->registerXPathNamespace(
			self::XML_NAMESPACE,
			self::XML_NAMESPACE_URL
		);

		$data = $xml->xpath(self::XPATH_CURRENCY);
		$currencies = array();

		foreach ($data as $currency)
		{
			$currencies[ (string) $currency->attributes()->currency] = (string) $currency->attributes()->rate;
		}

		return $currencies;
	}
public function convert_to_array ( $ raw_data ) { $ xml = new \ SimpleXMLElement ( $ raw_data ) ; $ xml -> registerXPathNamespace ( self :: XML_NAMESPACE , self :: XML_NAMESPACE_URL ) ; $ data = $ xml -> xpath ( self :: XPATH_CURRENCY ) ; $ currencies = array ( ) ; foreach ( $ data as $ currency ) { $ currencies [ ( string ) $ currency -> attributes ( ) -> currency ] = ( string ) $ currency -> attributes ( ) -> rate ; } return $ currencies ; }
Convert raw currency data to array of currencies
@param  string $raw_data currency data in XML format
@return array            currencies
Convert raw currency data to array of currencies