S
S
Sofia Bulgakova2017-09-13 20:56:29
Data conversion
Sofia Bulgakova, 2017-09-13 20:56:29

How to make the price table change depending on the exchange rate of the National Bank of Ukraine?

Good afternoon, there is a plate with prices: jacket-100 UAH, blouse-30, skirt-70 (these are the prices at the current euro exchange rate). I would like to have these prices in their current form, namely at the current rate of the NBU. I am zero in writing parsers.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zorca, 2017-09-13
@BazooQa

1. Send a request: https://bank.gov.ua/NBUStService/v1/statdirector...
2. Parse the received
3. Get the desired exchange rate
4. Display it in a tablet with euro conversion
5. Open a bottle of Staropramen
Get the euro exchange rate for current date:

<?php

$url = 'https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?valcode=EUR';

$xml = simplexml_load_file($url);

echo 'Курс евро: '.$xml->currency->rate;

Well, to move on, you need TK. :-)

A
Andrey Sanych, 2017-09-13
@mountpoint

Here is a list of sources where you can parse the exchange rate content.finance.ua/ru/xml/currency-cash
This list contains the exchange rates of all banks. Choose which one you need and convert.
To parse this list, just make a single function call:
If you are generally 0 in programming, then really hire a specialist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question