예제 #1
0
 public static function UpdateRates()
 {
     global $cphp_config;
     $json = json_decode(file_get_contents("http://openexchangerates.org/api/latest.json?app_id={$cphp_config->openexchangerates->app_id}"), true);
     $rates = $json["rates"];
     foreach ($rates as $currency => $rate) {
         ExchangeRate::Update($currency, $rate);
     }
 }