$res=(json_decode($a, true));
$low = $res['ticker']['low'];
$a=ouvrirpage("http://bitcoincharts.com/t/weighted_prices.json");
$res=(json_decode($a, true));
$day = $res['USD']['24h'];
echo min($low, $day);
function ouvrirpage($site){
$ch = curl_init($site);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
or if you don't like curl:
$res=(json_decode($a, true));
$low = $res['ticker']['low'];
$a=file_get_contents("http://bitcoincharts.com/t/weighted_prices.json");
$res=(json_decode($a, true));
$day = $res['USD']['24h'];
echo min($low, $day);
Cool. Got it working with the curl one (never rechecked that one with the /?> Last coding I did was GW-Basic in the early 90s.
![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
Anyway, bounty on its way to your signature bitcoin address. Thanks!