Skip to content

Instantly share code, notes, and snippets.

@mess110
Created February 28, 2014 15:03
Show Gist options
  • Select an option

  • Save mess110/9272627 to your computer and use it in GitHub Desktop.

Select an option

Save mess110/9272627 to your computer and use it in GitHub Desktop.
<?php
// keep lines shorter than 80 columns. it makes it easier to read
$url = 'http://coinmarketcap.northpole.ro/api/doge.json';
$data = json_decode(file_get_contents($url));
// try and comment out this method. see what it does. google it a bit
// an alternative to var_dump is print_r (bonus points if you tell me the diff)
// var_dump($data);
$price = $data->{'price'};
echo $price;
// some homework for you
// how do you get the totalSupply?
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment