I’d like to have a “current BitCoin price” on an HTML document. I found https://mtgox.com/api/0/data/ticker.php, which returns this:
{"ticker":{"high":12.43,"low":11.7,"avg":12.10615987,"vwap":12.098317306,"vol":58453,"last_all":12.34351,"last_local":12.34351,"last":12.34351,"buy":12.3341,"sell":12.34351}}
How can I set a PHP variable to just the value of last_all (12.34351)?
This is a JSON document. By using
json_decode, you can transform it in a PHP object, or PHP array if you set the optional 2nd parameter to true, as described in the documentation here.