- file_get_contents: documentation ( source)
- var_dump: documentation ( source)
- json_decode: documentation ( source)
<?php
class Gengi {
function __construct($currency=null) {
$this->url = "http://api02.gengi.is/currency/";
if ( !is_null( $currency ) ):
$this->url .= $currency;
endif;
$this->curr = $currency;
}
public function request() {
$result = file_get_contents($this->url);
var_dump(json_decode($result,true));
}
}
$orig = "{query}";
$gengi = new Gengi($orig);
$json = $gengi->request();