BerkPW adlı üyeden alıntı: mesajı görüntüle
<?php
  $ch = curl_init();

  curl_setopt($ch, CURLOPT_URL, "https://www.doviz.com/api/v1/currencies/all/latest");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

  $headers = array();
  $headers[] = "Content-Type: application/json";
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  curl_close ($ch);

  $json = json_decode($result);
  foreach ($json as $key => $value) {
    echo $value->full_name."<br>";
    echo "Alış: ".$value->buying."<br>";
    echo "Satış: ".$value->selling."<hr>";
  }
?>
Şöyle bir kod işinizi görür hocam
uckan adlı üyeden alıntı: mesajı görüntüle
Denemedim, hızlıca hazırladım varsa bir hata alıntılarsınız düzeltirim.

$array = array('USD', 'EUR');

foreach ($array as $doviz) {
$json = "https://www.doviz.com/api/v1/currencies/".$doviz."/latest";
$json_file = file_get_contents($json);
$data = json_decode($json_file);
echo ''.$doviz.' Alış: '.round($data->buying, 2).'';
echo ''.$doviz.' Satış: '.round($data->selling, 2).'';
}
2 nizede çok teşekkürlerimi sunuyorum. Sorunsuz çalıştı 2 side.