You can use file_get_contents
to get the data from the URL and json_decode
to parse the result, because the site you have linked is returning a JSON array, that can be parsed by php natively.
Example:
$bitcoin = json_decode(file_get_contents("https://btc-e.com/api/2/btc_usd/ticker"), true);
In the $bitcoin
variable you will have an associative array with the values of the JSON string.
Result:
array(1) {
["ticker"]=>
array(10) {
["high"]=>
float(844.90002)
["low"]=>
int(780)
["avg"]=>
float(812.45001)
["vol"]=>
float(13197445.40653)
["vol_cur"]=>
float(16187.2271)
["last"]=>
float(817.601)
["buy"]=>
float(817.951)
["sell"]=>
float(817.94)
["updated"]=>
int(1389273192)
["server_time"]=>
int(1389273194)
}
}