/home2/kerimkazan/dvf/magaza/currency.php
<?php
include('config.php');


function currency_api()
{
	$db = new DB();
	$api = m_url_get('https://service.ntv.com.tr/api/V2/finance/getfinancewidget?include=exchangesWidget,allGoldWidget,allbistwidget,allKriptoWidget,bistWidget'); 
	$api_json = json_decode($api,true);
	$api_json = $api_json['exchangesWidget'];
	
		$data = [
		'usd_try' => $api_json[0]['price'],
		'eur_try' => $api_json[1]['price'],
		'currency_update' => $db->now()
		];
	
		$query = $db->table('settings')->where('id','=','1')->update($data);
	
}

currency_api();