Advertisement
Guest User

bybis

a guest
Jul 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $ch = curl_init();
  2. $cv = curl_version();
  3.  
  4.  
  5.  
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  7.  
  8. curl_setopt($ch, CURLOPT_URL, "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml");
  9. $xml_data = curl_exec($ch);
  10. curl_close($ch);
  11.  
  12. $parser = simplexml_load_string($xml_data);
  13.  
  14.  
  15. echo $parser->Cube->Cube->Cube[5]['rate'];
  16. echo " GBP<br>";
  17. echo $parser->Cube->Cube->Cube[7]['rate'];
  18. echo " PLN<br>";
  19. echo $parser->Cube->Cube->Cube[9]['rate'];
  20. echo " SEK<br>";
  21. echo $parser->Cube->Cube->Cube[10]['rate'];
  22. echo " NOK<br>";
  23. echo $parser->Cube->Cube->Cube[4]['rate'];
  24. echo " DKK<br>";
  25. echo $parser->Cube->Cube->Cube[0]['rate'];
  26. echo " USD<br>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement