-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (26 loc) · 934 Bytes
/
index.php
File metadata and controls
39 lines (26 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
define("URL", "http://api.currencylayer.com/");
define("TOKEN", "9cf7e3ac7572d6c049e5e8d3e659db8f");
$ch =curl_init();
curl_setopt($ch, CURLOPT_URL, URL.'live?access_key='.TOKEN.'¤cies=ARS&format=1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$information = curl_exec($ch);
$extra_info = curl_getinfo($ch);
$status_code = $extra_info['http_code'];
$data = json_decode($information);
curl_close($ch);
?>
<?php require_once('header.php');?>
<br><br><br>
<section>
<div class="container-sm">
<h2>Dolar supermega oficial</h2>
<?php
if (($status_code == 200) && ($data->success == "true")) {
echo "Dolar oficial: $ ".$data->quotes->USDARS;
echo "<br>";
echo "Dolar turista: $ ".($data->quotes->USDARS)*1.3;
};
?>
</div>
<?php require_once('footer.php');?>