asdw_convertCurrency – Rechnet zwischen zwei Währungen zum aktuellen Kurs um Die Funktion asdw_convertCurrency () verwendet die API von Google/finance um zum aktuellen Kurs zwischen zwei Währungen umzurechnen. 
		
		
			
			
			
			
				
					
				| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function asdw_convertCurrency($amount, $from, $to)     {     // Converts an amount between currencies, using the google/finance/converter     // Example:     // echo asdw_convertCurrency(120.10, 'EUR', 'USD');       if ($from==$to)         {             return $amount;         }     if (trim($from)=='' || trim($to) == '')         {             die('Invalid parameter FROM or TO - currency in asdw_convertCurrency');         }       $data = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from&to=$to");     preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);     $converted = preg_replace("/[^0-9.]/", "", $converted[1]);     return $converted; // number_format(round($converted, 3),2); } | 
				
			 
		 
 Beispiel: 
		
		
			
			
			
			
				
					
				|  | echo asdw_convertCurrency(120.10, 'EUR', 'USD'); | 
				
			 
		 
 Sie kann auch verwendet werden um den aktuellen Umrechnungskurs zu…